misc_pterodactyl-panel/resources/scripts/api/server/schedules/getServerSchedule.ts

15 lines
523 B
TypeScript
Raw Permalink Normal View History

2020-03-18 06:33:53 +00:00
import http from '@/api/http';
import { rawDataToServerSchedule, Schedule } from '@/api/server/schedules/getServerSchedules';
export default (uuid: string, schedule: number): Promise<Schedule> => {
return new Promise((resolve, reject) => {
http.get(`/api/client/servers/${uuid}/schedules/${schedule}`, {
params: {
include: ['tasks'],
2020-03-18 06:33:53 +00:00
},
})
.then(({ data }) => resolve(rawDataToServerSchedule(data.attributes)))
.catch(reject);
});
};