mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 06:53:12 +00:00
43 lines
1 KiB
JavaScript
43 lines
1 KiB
JavaScript
import { get, post } from "../../../apiUtil";
|
|
import { API_URL } from "../../../constants";
|
|
|
|
export const fetchFollowUpsPaged = async ({
|
|
search = "",
|
|
page = 1,
|
|
pageSize = 12,
|
|
completed = false,
|
|
}) => {
|
|
const res = await get(
|
|
`${API_URL}/FollowUp/GetFollowUpList?search=${encodeURIComponent(
|
|
search
|
|
)}&page=${page}&pageSize=${pageSize}&completed=${completed}`
|
|
);
|
|
|
|
const rows = (res?.Data || []).map((x) => ({
|
|
id: x.Id,
|
|
reason: x.Reason,
|
|
scheduleDate: x.ScheduleDate,
|
|
account: x.Account,
|
|
assignedTo: x.AssignedTo,
|
|
locationName: x.LocationName,
|
|
workOrderNumber: x.WorkOrderNumber,
|
|
status: x.Status,
|
|
}));
|
|
|
|
return {
|
|
rows,
|
|
page: res.PageNumber,
|
|
pageSize: res.PageSize,
|
|
totalCount: res.TotalCount,
|
|
totalPages: res.TotalPages,
|
|
};
|
|
};
|
|
|
|
export const getFollowUpById = (id) =>
|
|
get(`${API_URL}/FollowUp/GetById?id=${id}`);
|
|
|
|
export const saveFollowUp = (payload) =>
|
|
post(`${API_URL}/FollowUp/Save`, payload);
|
|
|
|
export const deleteFollowUp = (id) =>
|
|
get(`${API_URL}/FollowUp/Delete?id=${id}`);
|