misc_pterodactyl-panel/resources/scripts/api/admin/servers/updateServer.ts
2021-05-20 16:00:46 -06:00

12 lines
487 B
TypeScript

import http from '@/api/http';
import { Server, rawDataToServer } from '@/api/admin/servers/getServers';
export default (id: number, server: Partial<Server>, include: string[] = []): Promise<Server> => {
return new Promise((resolve, reject) => {
http.patch(`/api/application/servers/${id}`, {
...server,
}, { params: { include: include.join(',') } })
.then(({ data }) => resolve(rawDataToServer(data)))
.catch(reject);
});
};