command repository added and a lot of other changes
This commit is contained in:
30
src/api/commandRepository.ts
Normal file
30
src/api/commandRepository.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user