Files
frontend/apps/sn/app/service/ppline.ts
T
2025-04-24 10:26:49 +09:00

40 lines
880 B
TypeScript

import axios from 'axios'
/**
* 하수관로 API
*/
const API_URL = `${process.env.NEXT_PUBLIC_SEWERAGE_API_URL}/v1/pplines`
const PAGE_NO = 1
const PAGE_SIZE = 20
export type PplineProps = {
ftreSmbol: string
swageLnkgPplPk: string
pbadmsEmd: string
sttyEmd: string
}
export const pplinesService = {
//목록
getPplines: (size: number = PAGE_SIZE, page: number = PAGE_NO) => {
return axios.get(`${API_URL}`)
},
//상세
getPpline: (swageLnkgPplPk: string) => {
return axios.get(`${API_URL}/${swageLnkgPplPk}`)
},
//저장
savePpline: (swageLnkgPplPk: string) => {
return axios.post(`${API_URL}`)
},
//수정
updatePpline: (swageLnkgPplPk: string) => {
return axios.put(`${API_URL}/${swageLnkgPplPk}`)
},
//삭제
removePpline: (swageLnkgPplPk: string) => {
return axios.delete(`${API_URL}/${swageLnkgPplPk}`)
}
}