fix: persist reported birth-time status
This commit is contained in:
@@ -132,7 +132,14 @@ export async function PATCH(request: Request) {
|
||||
}
|
||||
const applicationPatch = currentProfile
|
||||
? resolveAccountBirthTimeApplicationPatch(currentProfile, payload)
|
||||
: {};
|
||||
: payload.birth_time_source
|
||||
? {
|
||||
active_birth_time: null,
|
||||
birth_time: null,
|
||||
birth_time_status: "reported" as const,
|
||||
rectification_case_id: null,
|
||||
}
|
||||
: {};
|
||||
const baseProfile = {
|
||||
id: userId,
|
||||
...(payload.name !== undefined ? { name: payload.name } : {}),
|
||||
|
||||
@@ -217,10 +217,6 @@ export function resolveAccountBirthTimeApplicationPatch(
|
||||
const confirmed = current.birth_time_status === "confirmed"
|
||||
|| (current.birth_time_status === null && isBirthClockTime(current.birth_time ?? ""));
|
||||
if (confirmed) return {};
|
||||
if (!current.active_birth_time
|
||||
&& !current.birth_time
|
||||
&& current.birth_time_status !== "candidate"
|
||||
&& !current.rectification_case_id) return {};
|
||||
return {
|
||||
active_birth_time: null,
|
||||
birth_time: null,
|
||||
|
||||
Reference in New Issue
Block a user