29 lines
810 B
TypeScript
29 lines
810 B
TypeScript
import { getJson, postJson } from './client';
|
|
|
|
export type RestaurantAdminConfigResponse = {
|
|
contextId: string;
|
|
summary: string;
|
|
};
|
|
|
|
export type SetServiceWindowRequest = {
|
|
contextId: string;
|
|
day: number;
|
|
openAt: string;
|
|
closeAt: string;
|
|
updatedBy: string;
|
|
};
|
|
|
|
export type SetServiceWindowResponse = {
|
|
contextId: string;
|
|
applied: boolean;
|
|
message: string;
|
|
};
|
|
|
|
export async function loadDashboard(contextId: string): Promise<RestaurantAdminConfigResponse> {
|
|
return getJson<RestaurantAdminConfigResponse>(`/api/restaurant/admin/config?contextId=${encodeURIComponent(contextId)}`);
|
|
}
|
|
|
|
export async function setServiceWindow(request: SetServiceWindowRequest): Promise<SetServiceWindowResponse> {
|
|
return postJson<SetServiceWindowResponse>('/api/restaurant/admin/service-window', request);
|
|
}
|