mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-24 06:28:49 -05:00
fix: userId migration (#2453)
This commit is contained in:
@@ -31,6 +31,9 @@ export async function POST(req: Request, context: Context): Promise<Response> {
|
||||
);
|
||||
}
|
||||
|
||||
// remove userId from attributes because it is not allowed to be updated
|
||||
const { userId: userIdAttr, ...updatedAttributes } = inputValidation.data.attributes;
|
||||
|
||||
let person = await getPersonByUserId(environmentId, userId);
|
||||
|
||||
if (!person) {
|
||||
@@ -40,11 +43,10 @@ export async function POST(req: Request, context: Context): Promise<Response> {
|
||||
}
|
||||
|
||||
// Check if the person is already up to date
|
||||
const updatedAtttributes = inputValidation.data.attributes;
|
||||
const oldAttributes = person.attributes;
|
||||
let isUpToDate = true;
|
||||
for (const key in updatedAtttributes) {
|
||||
if (updatedAtttributes[key] !== oldAttributes[key]) {
|
||||
for (const key in updatedAttributes) {
|
||||
if (updatedAttributes[key] !== oldAttributes[key]) {
|
||||
isUpToDate = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user