fix: use PATCH for vehicle type update and correct permission check in FahrzeugEinstellungen
This commit is contained in:
@@ -38,7 +38,7 @@ export default function FahrzeugEinstellungen() {
|
|||||||
const { hasPermission } = usePermissionContext();
|
const { hasPermission } = usePermissionContext();
|
||||||
const { showSuccess, showError } = useNotification();
|
const { showSuccess, showError } = useNotification();
|
||||||
|
|
||||||
const canEdit = hasPermission('fahrzeuge:edit');
|
const canEdit = hasPermission('checklisten:manage_templates');
|
||||||
|
|
||||||
const { data: fahrzeugTypen = [], isLoading } = useQuery({
|
const { data: fahrzeugTypen = [], isLoading } = useQuery({
|
||||||
queryKey: ['fahrzeug-typen'],
|
queryKey: ['fahrzeug-typen'],
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const fahrzeugTypenApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
update: async (id: number, data: Partial<FahrzeugTyp>): Promise<FahrzeugTyp> => {
|
update: async (id: number, data: Partial<FahrzeugTyp>): Promise<FahrzeugTyp> => {
|
||||||
const r = await api.put(`/api/fahrzeug-typen/${id}`, data);
|
const r = await api.patch(`/api/fahrzeug-typen/${id}`, data);
|
||||||
return r.data.data;
|
return r.data.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user