Skip to content

Commit

Permalink
chore: autofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Dec 11, 2023
1 parent b39963d commit f6f7325
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions routes/[version]/collections/_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,21 @@ async function saveCollection(user, data) {
}

async function changeOwnership(collectionId, userId) {

const SERVICE_UID = 3; // FIXME move to settings?

const ownerId = await db.select('userId').from(USER_COLLECTIONS_TABLE).where('id', collectionId);
if (!ownerId || ownerId[0].userId !== SERVICE_UID)
return 'Invalid collection selected';
const ownerId = await db
.select('userId')
.from(USER_COLLECTIONS_TABLE)
.where('id', collectionId);
if (!ownerId || ownerId[0].userId !== SERVICE_UID) return 'Invalid collection selected';

const targetIds = await db.select('dataSourceId').from(USER_COLLECTIONS_DATASOURCES_TABLE).where('collectionId', collectionId);
const targetIds = await db
.select('dataSourceId')
.from(USER_COLLECTIONS_DATASOURCES_TABLE)
.where('collectionId', collectionId);

const targets = [];
targetIds.forEach(function(item){
targetIds.forEach(function (item) {
targets.push(item.dataSourceId);
});

Expand Down

0 comments on commit f6f7325

Please sign in to comment.