2021-01-08 16:44:05 +00:00
|
|
|
import http from '@/api/http';
|
|
|
|
import { Nest, rawDataToNest } from '@/api/admin/nests/getNests';
|
|
|
|
|
2021-01-15 16:41:15 +00:00
|
|
|
export default (id: number, name: string, description: string | null, include: string[] = []): Promise<Nest> => {
|
2021-01-08 16:44:05 +00:00
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
http.patch(`/api/application/nests/${id}`, {
|
|
|
|
name, description,
|
2021-01-15 16:41:15 +00:00
|
|
|
}, { params: { include: include.join(',') } })
|
2021-01-08 16:44:05 +00:00
|
|
|
.then(({ data }) => resolve(rawDataToNest(data)))
|
|
|
|
.catch(reject);
|
|
|
|
});
|
|
|
|
};
|