fix(stores): error with undefined user
Some checks failed
TrafficCue Server CI / check (push) Failing after 59s
TrafficCue Server CD / build (push) Successful in 2m30s

This commit is contained in:
2025-09-27 12:12:42 +02:00
parent c59df0bf6a
commit a0d08e5041

View File

@ -66,7 +66,7 @@ export async function sync(payload: SyncPayload, user: User) {
const changes: Store[] = [];
// Apply changes from client
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) {
// Store doesn't exist, create it
const newStore = new Store();