mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-04-09 20:39:02 +02:00
small migration and error fix
This commit is contained in:
parent
a8654e3d64
commit
85fcc8be96
@ -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) {
|
||||
throw new HttpError(401);
|
||||
}
|
||||
const dailyStats = await context.entities.DailyStats.findFirstOrThrow({
|
||||
const dailyStats = await context.entities.DailyStats.findFirst({
|
||||
orderBy: {
|
||||
date: 'desc',
|
||||
},
|
||||
@ -23,6 +23,9 @@ export const getDailyStats: GetDailyStats<void, DailyStatsValues> = async (_args
|
||||
sources: true,
|
||||
},
|
||||
});
|
||||
if (!dailyStats) {
|
||||
throw new HttpError(204, 'No daily stats generated yet.');
|
||||
}
|
||||
|
||||
const weeklyStats = await context.entities.DailyStats.findMany({
|
||||
orderBy: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user