creating plan possible

This commit is contained in:
2025-10-13 23:48:08 +02:00
parent e260f91d18
commit 310b7806e5
4 changed files with 258 additions and 47 deletions

View File

@@ -122,12 +122,25 @@ export const shiftPlanService = {
}
},
/*getTemplates: async (): Promise<ShiftPlan[]> => {
const response = await fetch(`${API_BASE}/templates`, {
headers: getAuthHeaders()
async revertToDraft(id: string): Promise<ShiftPlan> {
const response = await fetch(`${API_BASE}/${id}/revert-to-draft`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
...authService.getAuthHeaders()
}
});
return handleResponse(response);
},*/
if (!response.ok) {
if (response.status === 401) {
authService.logout();
throw new Error('Nicht authorisiert - bitte erneut anmelden');
}
throw new Error('Fehler beim Zurücksetzen des Schichtplans');
}
return response.json();
},
// Get specific template or plan
getTemplate: async (id: string): Promise<ShiftPlan> => {