Files

31 lines
818 B
TypeScript
Raw Permalink Normal View History

2022-12-15 19:06:14 -07:00
import http from '@/api/http';
import { Mount, rawDataToMount } from '@/api/admin/mounts/getMounts';
2023-01-12 12:31:47 -07:00
export default (
id: number,
name: string,
description: string | null,
source: string,
target: string,
readOnly: boolean,
userMountable: boolean,
include: string[] = [],
): Promise<Mount> => {
2022-12-15 19:06:14 -07:00
return new Promise((resolve, reject) => {
2023-01-12 12:31:47 -07:00
http.patch(
`/api/application/mounts/${id}`,
{
name,
description,
source,
target,
read_only: readOnly,
user_mountable: userMountable,
},
{ params: { include: include.join(',') } },
)
2022-12-15 19:06:14 -07:00
.then(({ data }) => resolve(rawDataToMount(data)))
.catch(reject);
});
};