mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-09-29 04:53:18 +02:00
small migration and error fix
This commit is contained in:
@@ -1,11 +0,0 @@
|
|||||||
--- template/app/migrations/20241031103046_remove_checkout_session_id/migration.sql
|
|
||||||
+++ opensaas-sh/app/migrations/20241031103046_remove_checkout_session_id/migration.sql
|
|
||||||
@@ -0,0 +1,8 @@
|
|
||||||
+/*
|
|
||||||
+ Warnings:
|
|
||||||
+
|
|
||||||
+ - You are about to drop the column `checkoutSessionId` on the `User` table. All the data in the column will be lost.
|
|
||||||
+
|
|
||||||
+*/
|
|
||||||
+-- AlterTable
|
|
||||||
+ALTER TABLE "User" DROP COLUMN "checkoutSessionId";
|
|
@@ -15,7 +15,7 @@ export const getDailyStats: GetDailyStats<void, DailyStatsValues> = async (_args
|
|||||||
if (!context.user?.isAdmin) {
|
if (!context.user?.isAdmin) {
|
||||||
throw new HttpError(401);
|
throw new HttpError(401);
|
||||||
}
|
}
|
||||||
const dailyStats = await context.entities.DailyStats.findFirstOrThrow({
|
const dailyStats = await context.entities.DailyStats.findFirst({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
date: 'desc',
|
date: 'desc',
|
||||||
},
|
},
|
||||||
@@ -23,6 +23,9 @@ export const getDailyStats: GetDailyStats<void, DailyStatsValues> = async (_args
|
|||||||
sources: true,
|
sources: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (!dailyStats) {
|
||||||
|
throw new HttpError(204, 'No daily stats generated yet.');
|
||||||
|
}
|
||||||
|
|
||||||
const weeklyStats = await context.entities.DailyStats.findMany({
|
const weeklyStats = await context.entities.DailyStats.findMany({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
|
Reference in New Issue
Block a user