25 lines
706 B
TypeScript
25 lines
706 B
TypeScript
import BaseRepository from '@/api/repositories/BaseRepository';
|
|
|
|
export default class AreaRepository extends BaseRepository {
|
|
|
|
public loadAllAreas(): Promise<any> {
|
|
return this.axiosClient(`area`);
|
|
}
|
|
|
|
public loadArea(areaId: string): Promise<any> {
|
|
return this.axiosClient(`area/${areaId}`);
|
|
}
|
|
|
|
public createArea(area: any): Promise<any> {
|
|
return this.axiosClient.post(`area`, area);
|
|
}
|
|
|
|
public editArea(area: any): Promise<any> {
|
|
return this.axiosClient.put(`area/${area.id}`, area);
|
|
}
|
|
|
|
public setUsers(area: any, userIds: any): Promise<any> {
|
|
return this.axiosClient.post(`area/${area.id}/setUsers`, {userIds: userIds});
|
|
}
|
|
}
|