Skip to content

Commit

Permalink
backend: api: users: social_url: allow setting empty URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed Apr 18, 2024
1 parent 28bda2d commit 7b1c602
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backend/src/app/api/v0/users/social_url/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function PATCH(request: NextRequest) {
const user_id = await checkUserToken(authToken);
if (user_id instanceof NextResponse) return user_id;

let social_url: string;
let social_url: string | null;
try {
const data = await request.json();
social_url = data.social_url;
Expand All @@ -35,7 +35,11 @@ export async function PATCH(request: NextRequest) {
status_code: 400,
});
}


if (social_url === "") {
social_url = null;
}

let userdata_id = null;
try {
const db_query = await databases.listDocuments(
Expand Down

0 comments on commit 7b1c602

Please sign in to comment.