@axium/storage 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.js +4 -4
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -326,7 +326,7 @@ addRoute({
|
|
|
326
326
|
const userId = event.params.id;
|
|
327
327
|
await checkAuthForUser(event, userId);
|
|
328
328
|
const [items, usage, limits] = await Promise.all([
|
|
329
|
-
database.selectFrom('storage').where('userId', '=', userId).where('trashedAt', '
|
|
329
|
+
database.selectFrom('storage').where('userId', '=', userId).where('trashedAt', '!=', null).selectAll().execute(),
|
|
330
330
|
currentUsage(userId),
|
|
331
331
|
getLimits(userId),
|
|
332
332
|
]).catch(withError('Could not fetch data'));
|
|
@@ -344,8 +344,8 @@ addRoute({
|
|
|
344
344
|
const items = await database
|
|
345
345
|
.selectFrom('storage')
|
|
346
346
|
.where('userId', '=', userId)
|
|
347
|
-
.where('trashedAt', '
|
|
348
|
-
.where('parentId', '
|
|
347
|
+
.where('trashedAt', '!=', null)
|
|
348
|
+
.where('parentId', '=', null)
|
|
349
349
|
.selectAll()
|
|
350
350
|
.execute()
|
|
351
351
|
.catch(withError('Could not get storage items'));
|
|
@@ -362,7 +362,7 @@ addRoute({
|
|
|
362
362
|
await checkAuthForUser(event, userId);
|
|
363
363
|
const items = await database
|
|
364
364
|
.selectFrom('storage')
|
|
365
|
-
.where('trashedAt', '
|
|
365
|
+
.where('trashedAt', '!=', null)
|
|
366
366
|
.where(({ and, not, exists, selectFrom }) => {
|
|
367
367
|
const existsInAcl = (column) => exists(selectFrom('acl.storage')
|
|
368
368
|
.whereRef('itemId', '=', `storage.${column}`)
|