2021-01-08 22:18:08 +00:00
|
|
|
import http from '@/api/http';
|
|
|
|
import { Mount, rawDataToMount } from '@/api/admin/mounts/getMounts';
|
|
|
|
|
2021-01-15 16:41:15 +00:00
|
|
|
export default (id: number, name: string, description: string | null, source: string, target: string, readOnly: boolean, userMountable: boolean, include: string[] = []): Promise<Mount> => {
|
2021-01-08 22:18:08 +00:00
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
http.patch(`/api/application/mounts/${id}`, {
|
|
|
|
name, description, source, target, read_only: readOnly, user_mountable: userMountable,
|
2021-01-15 16:41:15 +00:00
|
|
|
}, { params: { include: include.join(',') } })
|
2021-01-08 22:18:08 +00:00
|
|
|
.then(({ data }) => resolve(rawDataToMount(data)))
|
|
|
|
.catch(reject);
|
|
|
|
});
|
|
|
|
};
|