fix: remove remaining /api/ double-prefix from template literal API calls
Previous fix missed backtick template strings. Fixed 7 more api.*() calls in appointments, deadlines, settings, and einstellungen pages.
This commit is contained in:
@@ -22,7 +22,7 @@ export default function EinstellungenPage() {
|
||||
refetch,
|
||||
} = useQuery({
|
||||
queryKey: ["tenant-current", tenantId],
|
||||
queryFn: () => api.get<Tenant>(`/api/tenants/${tenantId}`),
|
||||
queryFn: () => api.get<Tenant>(`/tenants/${tenantId}`),
|
||||
enabled: !!tenantId,
|
||||
});
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ export function AppointmentModal({ open, onClose, appointment }: AppointmentModa
|
||||
|
||||
const updateMutation = useMutation({
|
||||
mutationFn: (body: Record<string, unknown>) =>
|
||||
api.put<Appointment>(`/api/appointments/${appointment!.id}`, body),
|
||||
api.put<Appointment>(`/appointments/${appointment!.id}`, body),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["appointments"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["dashboard"] });
|
||||
|
||||
@@ -64,7 +64,7 @@ export function DeadlineList() {
|
||||
|
||||
const completeMutation = useMutation({
|
||||
mutationFn: (id: string) =>
|
||||
api.patch<Deadline>(`/api/deadlines/${id}/complete`),
|
||||
api.patch<Deadline>(`/deadlines/${id}/complete`),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["deadlines"] });
|
||||
toast.success("Frist als erledigt markiert");
|
||||
|
||||
@@ -68,7 +68,7 @@ export function CalDAVSettings({ tenant }: { tenant: Tenant }) {
|
||||
typeof window !== "undefined"
|
||||
? localStorage.getItem("kanzlai_tenant_id")
|
||||
: null;
|
||||
return api.put<Tenant>(`/api/tenants/${tenantId}/settings`, {
|
||||
return api.put<Tenant>(`/tenants/${tenantId}/settings`, {
|
||||
caldav: cfg,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -32,13 +32,13 @@ export function TeamSettings() {
|
||||
} = useQuery({
|
||||
queryKey: ["tenant-members", tenantId],
|
||||
queryFn: () =>
|
||||
api.get<UserTenant[]>(`/api/tenants/${tenantId}/members`),
|
||||
api.get<UserTenant[]>(`/tenants/${tenantId}/members`),
|
||||
enabled: !!tenantId,
|
||||
});
|
||||
|
||||
const inviteMutation = useMutation({
|
||||
mutationFn: (data: { email: string; role: string }) =>
|
||||
api.post(`/api/tenants/${tenantId}/invite`, data),
|
||||
api.post(`/tenants/${tenantId}/invite`, data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["tenant-members"] });
|
||||
setEmail("");
|
||||
@@ -52,7 +52,7 @@ export function TeamSettings() {
|
||||
|
||||
const removeMutation = useMutation({
|
||||
mutationFn: (userId: string) =>
|
||||
api.delete(`/api/tenants/${tenantId}/members/${userId}`),
|
||||
api.delete(`/tenants/${tenantId}/members/${userId}`),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["tenant-members"] });
|
||||
toast.success("Mitglied entfernt");
|
||||
|
||||
Reference in New Issue
Block a user