sg-delivery-partner/app/api/dashboardApi.ts

28 lines
725 B
TypeScript

import {
DeliveryPartnerLocationRequest,
DeliveryPartnerLocationResponse,
ToggleStatusPayload,
ToggleStatusResponse,
} from '@interfaces';
import { apiClient } from '@services';
export const toggleStatus = async (
payload: ToggleStatusPayload,
): Promise<ToggleStatusResponse> => {
const response = await apiClient.patch<ToggleStatusResponse>(
'/delivery-partners/availability',
payload,
);
return response;
};
export const deliveryPartnerLocation = async (
payload: DeliveryPartnerLocationRequest,
): Promise<DeliveryPartnerLocationResponse> => {
const response = await apiClient.post<DeliveryPartnerLocationResponse>(
'/delivery-partners/location',
payload,
);
return response;
};