fix(stores): error with undefined user
This commit is contained in:
@ -66,7 +66,7 @@ export async function sync(payload: SyncPayload, user: User) {
|
|||||||
const changes: Store[] = [];
|
const changes: Store[] = [];
|
||||||
// Apply changes from client
|
// Apply changes from client
|
||||||
for(const change of payload.changes) {
|
for(const change of payload.changes) {
|
||||||
const store = await Store.findOneBy({ id: change.id });
|
const store = await Store.findOne({ where: { id: change.id }, relations: { user: true } });
|
||||||
if(!store) {
|
if(!store) {
|
||||||
// Store doesn't exist, create it
|
// Store doesn't exist, create it
|
||||||
const newStore = new Store();
|
const newStore = new Store();
|
||||||
|
|||||||
Reference in New Issue
Block a user