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'],
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.then(({ data }) => resolve(rawDataToServerSchedule(data.attributes)))
|
|
|
|
.catch(reject);
|
|
|
|
});
|
|
|
|
};
|