chore: profile表加上时间列

This commit is contained in:
14790897 2024-03-07 10:47:55 +08:00
parent 559b4010c2
commit a0e88d8c8d

View File

@ -184,20 +184,29 @@ export async function insertUserProfile(data: any, supabase: SupabaseClient) {
} else {
user = data;
}
if (user) {
const currentTime = new Date().toISOString(); // 生成ISO格式的时间字符串
const { data, error: profileError } = await supabase
.from("profiles")
.upsert([{ id: user.id, email: user.email }]);
.upsert([
{
id: user.id,
email: user.email,
created_at: currentTime, // 添加创建时间
},
]);
if (profileError) {
console.error("Failed to create user profile:", profileError);
Sentry.captureException(profileError);
}
//sentry
Sentry.setUser({
email: user.email,
id: user.id,
ip_address: "{{auto}}}",
ip_address: "{{auto}}",
});
}
}