code to call recorder functions from frointend
This commit is contained in:
@@ -8,6 +8,8 @@ import RoomRepository from './roomRepository';
|
||||
import RecorderRepository from './recorderRepository';
|
||||
import CommandRepository from './commandRepository';
|
||||
|
||||
import ControlRepository from './controlRepository';
|
||||
|
||||
|
||||
export default function get(name: string) {
|
||||
switch (name) {
|
||||
@@ -29,6 +31,9 @@ export default function get(name: string) {
|
||||
case 'command': {
|
||||
return CommandRepository;
|
||||
}
|
||||
case 'control': {
|
||||
return ControlRepository;
|
||||
}
|
||||
default: {
|
||||
// statements;
|
||||
break;
|
||||
|
||||
16
src/api/controlRepository.ts
Normal file
16
src/api/controlRepository.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// groupRepository.ts
|
||||
|
||||
// @ts-ignore
|
||||
import Repository from './Repository';
|
||||
|
||||
const commandResource = '/control';
|
||||
|
||||
import {dictEmptyValToNull} from '@/utils';
|
||||
|
||||
export default {
|
||||
runRecorderCommand(recorderId: any, commandId: any, parameters: any) {
|
||||
return Repository.post(`${commandResource}?recorder_id=${recorderId}&command_id=${commandId}`,
|
||||
{parameters: dictEmptyValToNull(parameters)});
|
||||
},
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user