fix: Null value being set in updatedAt column when creating user

This commit is contained in:
Jesse Wierzbinski 2024-04-11 18:23:36 -10:00
parent 87cf7d6408
commit 0af63dda3c
No known key found for this signature in database

View file

@ -356,7 +356,6 @@ export const resolveUser = async (
const foundLocalUser = await findFirstUser({ const foundLocalUser = await findFirstUser({
where: (user, { eq }) => eq(user.id, uuid[0]), where: (user, { eq }) => eq(user.id, uuid[0]),
with: userRelations,
}); });
return foundLocalUser || null; return foundLocalUser || null;
@ -422,6 +421,7 @@ export const resolveUser = async (
inbox: data.inbox, inbox: data.inbox,
outbox: data.outbox, outbox: data.outbox,
}, },
updatedAt: new Date(data.created_at).toISOString(),
instanceId: instance.id, instanceId: instance.id,
avatar: data.avatar avatar: data.avatar
? Object.entries(data.avatar)[0][1].content ? Object.entries(data.avatar)[0][1].content
@ -453,7 +453,6 @@ export const resolveUser = async (
const finalUser = await findFirstUser({ const finalUser = await findFirstUser({
where: (user, { eq }) => eq(user.id, newUser.id), where: (user, { eq }) => eq(user.id, newUser.id),
with: userRelations,
}); });
if (!finalUser) return null; if (!finalUser) return null;
@ -491,7 +490,6 @@ export const resolveWebFinger = async (
return ( return (
(await findFirstUser({ (await findFirstUser({
where: (user, { eq }) => eq(user.id, foundUser[0].User.id), where: (user, { eq }) => eq(user.id, foundUser[0].User.id),
with: userRelations,
})) || null })) || null
); );
@ -597,7 +595,6 @@ export const createNewLocalUser = async (data: {
const finalUser = await findFirstUser({ const finalUser = await findFirstUser({
where: (user, { eq }) => eq(user.id, newUser.id), where: (user, { eq }) => eq(user.id, newUser.id),
with: userRelations,
}); });
if (!finalUser) return null; if (!finalUser) return null;