Update
This commit is contained in:
1 parent
b7f7d7e793
commit
c01d747352
14 files changed
+987
-294
No files matched your search
+13
-2
@@ -48,6 +48,7 @@ export type ZammadSyncExistingFields = {
|
||||
type: boolean;
|
||||
projectName: boolean;
|
||||
budget: boolean;
|
||||
overrideBudget: boolean;
|
||||
};
|
||||
|
||||
export type ZammadSyncChange = {
|
||||
@@ -163,6 +164,14 @@ async function requestRestoreEndpoint<T>(path: string, options: ApiRequestInit)
|
||||
return request<T>(path, options);
|
||||
}
|
||||
|
||||
function backupValidationSql(sql: string) {
|
||||
const lines = sql.replace(/^\uFEFF/, "").split(/\r?\n/);
|
||||
const marker = lines.find((line) => line.includes("TicketTracker Datenbankexport")) ?? "-- TicketTracker Datenbankexport";
|
||||
const structuralLines = lines.filter((line) => /^--\s*(?:[a-z_][a-z0-9_]*:\s*\d+\s+Datensatz|columns\s+[a-z_][a-z0-9_]*:)/i.test(line.trim()));
|
||||
|
||||
return [marker, ...structuralLines].join("\n");
|
||||
}
|
||||
|
||||
export function login(payload: { username: string; password: string }) {
|
||||
return request<{ user: AuthUser }>("/api/auth/login", {
|
||||
method: "POST",
|
||||
@@ -242,7 +251,7 @@ export function validateSetupBackup(sql: string) {
|
||||
method: "POST",
|
||||
timeoutMs: 60_000,
|
||||
headers: { "Content-Type": "text/plain; charset=utf-8" },
|
||||
body: sql
|
||||
body: backupValidationSql(sql)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -310,7 +319,7 @@ export function validateDatabaseBackup(sql: string) {
|
||||
method: "POST",
|
||||
timeoutMs: 60_000,
|
||||
headers: { "Content-Type": "text/plain; charset=utf-8" },
|
||||
body: sql
|
||||
body: backupValidationSql(sql)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -531,6 +540,7 @@ export function createProject(payload: {
|
||||
teamspaceProject?: string | null;
|
||||
isDefault: boolean;
|
||||
hourBudgetMinutes?: number | null;
|
||||
budgetSyncDisabled?: boolean;
|
||||
manualConsumptionMinutes?: number | null;
|
||||
}>;
|
||||
description: string;
|
||||
@@ -558,6 +568,7 @@ export function updateProject(
|
||||
teamspaceProject?: string | null;
|
||||
isDefault: boolean;
|
||||
hourBudgetMinutes?: number | null;
|
||||
budgetSyncDisabled?: boolean;
|
||||
manualConsumptionMinutes?: number | null;
|
||||
}>;
|
||||
description: string;
|
||||
|
||||
Reference in new issue
Block a user