// groupRepository.ts

// @ts-ignore
import Repository from './Repository';
import {dictEmptyValToNull} from '@/utils';

const resource = '/room';

export default {
    getRooms() {
        return Repository.get(`${resource}`);
    },

    getRoom(roomId: number) {
        return Repository.get(`${resource}/${roomId}`);
    },

    deleteRoom(roomId: number) {
        return Repository.delete(`${resource}/${roomId}`);
    },

    createRoom(roomData: any) {
        return Repository.post(`${resource}`, dictEmptyValToNull(roomData));
    },

    updateRoom(roomId: number, roomData: any) {
        return Repository.put(`${resource}/${roomId}`, dictEmptyValToNull(roomData));
    },
};
