import {
  DataGroup,
  DataGroupSearch,
} from "@/components/models/management/DataGroup";

import { request } from "@/components/service/index";
export const DataGroupService = {
  add: (payload: DataGroup) => {
    return request.post("/api/datagroup", payload);
  },
  getAll: () => {
    return request.get("/api/datagroup", {});
  },
  delete: (id: Number) => {
    return request.delete(`/api/datagroup/${id}`, {});
  },
  view: (id: Number) => {
    return request.get(`/api/datagroup/${id}`, {});
  },
  update: (id: number, updatePayload: DataGroup) => {
    return request.put(`/api/datagroup/${id}`, updatePayload);
  },
  search: (payload: DataGroupSearch) => {
    return request.get("/api/datagroup/search", payload);
  },
};
