v3: allow users to edit dump title
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 2m54s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 2m54s
This commit is contained in:
@@ -420,6 +420,7 @@ export function isCreateUrlDumpRequest(
|
||||
|
||||
export interface UpdateDumpRequest {
|
||||
url?: string;
|
||||
title?: string;
|
||||
comment?: string;
|
||||
isPrivate?: boolean;
|
||||
}
|
||||
@@ -428,6 +429,11 @@ export function isUpdateDumpRequest(obj: unknown): obj is UpdateDumpRequest {
|
||||
if (!obj || typeof obj !== "object") return false;
|
||||
const o = obj as Record<string, unknown>;
|
||||
if ("url" in o && typeof o.url !== "string" && o.url !== null) return false;
|
||||
if ("title" in o) {
|
||||
if (typeof o.title !== "string") return false;
|
||||
const trimmed = (o.title as string).trim();
|
||||
if (!trimmed || trimmed.length > VALIDATION.DUMP_TITLE_MAX) return false;
|
||||
}
|
||||
if (
|
||||
"comment" in o && typeof o.comment !== "string" && o.comment !== null
|
||||
) return false;
|
||||
|
||||
Reference in New Issue
Block a user