diff --git a/src/lib/media.ts b/src/lib/media.ts index 099303c..9554660 100644 --- a/src/lib/media.ts +++ b/src/lib/media.ts @@ -11,7 +11,7 @@ export function generateSAS(permissions: string, expirationMinutes: number) { return generateBlobSASQueryParameters({ containerName: process.env.BLOB_STORAGE_CONTAINER!, permissions: ContainerSASPermissions.parse(permissions), - startsOn: new Date(), + startsOn: moment().subtract(1, 'm').toDate(), expiresOn: moment().add(expirationMinutes, 'm').toDate(), }, sharedKeyCredential).toString() } diff --git a/src/plugins/api/apps.ts b/src/plugins/api/apps.ts index 4f92941..323aa32 100644 --- a/src/plugins/api/apps.ts +++ b/src/plugins/api/apps.ts @@ -110,22 +110,7 @@ function appsRoute(server: FastifyInstance( - `SELECT - a.id, - a.userId, - a.version, - a.name, - a.imageUrl, - a.coverImageUrl, - a.iconImageUrl, - a.about, - a.websiteUrl, - a.companyName, - a.rating, - a.users, - a.created - FROM Apps a - WHERE a.pk = '${APP_PARTITION_KEY}' AND a.active = true ORDER BY a.${sort}`, + `SELECT * FROM Apps a WHERE a.pk = '${APP_PARTITION_KEY}' AND a.active = true ORDER BY a.${sort}`, { maxItemCount: 40, continuation, @@ -185,21 +170,7 @@ function selfAppsRoute(server: FastifyInstance( - `SELECT - a.id, - a.version, - a.name, - a.imageUrl, - a.coverImageUrl, - a.iconImageUrl, - a.about, - a.websiteUrl, - a.companyName - a.rating, - a.users, - a.created - FROM Apps a - WHERE a.pk = '${APP_PARTITION_KEY}' AND a.userId = ${request.viewer.id} ORDER BY a.${sort}`, + `SELECT * FROM Apps a WHERE a.pk = '${APP_PARTITION_KEY}' AND a.userId = ${request.viewer.id} ORDER BY a.${sort}`, {} ).fetchAll()