feat: update setUserLocationDetails to create new user address entry instead of updating
This commit is contained in:
@@ -202,13 +202,13 @@ export class UserService {
|
||||
});
|
||||
}
|
||||
|
||||
// 4️⃣ Update user address
|
||||
return tx.userAddressDetails.update({
|
||||
where: { id: userId },
|
||||
return tx.userAddressDetails.create({
|
||||
data: {
|
||||
countryXid: country.id,
|
||||
stateXid: state.id,
|
||||
cityXid: city.id,
|
||||
user: { connect: { id: userId } },
|
||||
country: { connect: { id: country.id } },
|
||||
states: { connect: { id: state.id } },
|
||||
cities: { connect: { id: city.id } },
|
||||
address1: locationAddress ?? '',
|
||||
pinCode,
|
||||
locationName: locationName ?? null,
|
||||
locationAddress: locationAddress ?? null,
|
||||
@@ -216,6 +216,7 @@ export class UserService {
|
||||
locationLong: longitude ?? null,
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user