fix: integration fixes from final review
- useSettings: upsert instead of update (safe if migration rows missing) - invite-admin-user: return created_at and last_sign_in_at in response - UserManagementPage: clear deleteError when opening new confirmation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,8 +32,7 @@ export function useSettings() {
|
||||
const updatePrice = async (key, value) => {
|
||||
const { error } = await supabase
|
||||
.from('settings')
|
||||
.update({ value: String(value), updated_at: new Date().toISOString() })
|
||||
.eq('key', key);
|
||||
.upsert({ key, value: String(value), updated_at: new Date().toISOString() }, { onConflict: 'key' });
|
||||
|
||||
if (!error) {
|
||||
const thickness = parseInt(key.replace('price_', ''), 10);
|
||||
|
||||
@@ -244,7 +244,7 @@ const UserManagementPage = () => {
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
onClick={() => setConfirmDeleteId(user.id)}
|
||||
onClick={() => { setConfirmDeleteId(user.id); setDeleteError(''); }}
|
||||
title="Удалить пользователя"
|
||||
style={{
|
||||
background: 'transparent',
|
||||
|
||||
@@ -60,7 +60,12 @@ Deno.serve(async (req) => {
|
||||
}
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({ id: data.user.id, email: data.user.email }),
|
||||
JSON.stringify({
|
||||
id: data.user.id,
|
||||
email: data.user.email,
|
||||
created_at: data.user.created_at,
|
||||
last_sign_in_at: data.user.last_sign_in_at ?? null,
|
||||
}),
|
||||
{ headers: { ...corsHeaders, 'Content-Type': 'application/json' } },
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user