// groupRepository.ts

// @ts-ignore
import Repository from './Repository';

const commandResource = '/command';

import {dictEmptyValToNull} from '@/utils';

export default {
    getCommands() {
        return Repository.get(`${commandResource}`);
    },

    getCommand(commandId: number) {
        return Repository.get(`${commandResource}/${commandId}`);
    },

    deleteCommand(commandId: number) {
        return Repository.delete(`${commandResource}/${commandId}`);
    },

    createCommand(commandData: any) {
        return Repository.post(`${commandResource}`, dictEmptyValToNull(commandData));
    },

    updateCommand(commandId: number, commandData: any) {
        return Repository.put(`${commandResource}/${commandId}`, dictEmptyValToNull(commandData));
    },
};
