Skip to content

Commit 4ea049b

Browse files
committed
fix(model): add missing cascades
style: improve code style
1 parent 712e3b2 commit 4ea049b

34 files changed

Lines changed: 26 additions & 303 deletions

File tree

src/api/admin/statistics/alert-logs/[id]/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
22
import { ContainerRegistrationKeys } from "@medusajs/framework/utils";
33

4-
/**
5-
* GET /admin/statistics/alert-logs/:id
6-
* Get a specific alert log
7-
*/
84
export async function GET(
95
req: MedusaRequest,
106
res: MedusaResponse

src/api/admin/statistics/alert-logs/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
22
import { ContainerRegistrationKeys } from "@medusajs/framework/utils";
33

4-
/**
5-
* GET /admin/statistics/alert-logs
6-
* List all alert logs
7-
*/
84
export async function GET(
95
req: MedusaRequest,
106
res: MedusaResponse

src/api/admin/statistics/alerts/[id]/logs/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
22
import { ContainerRegistrationKeys } from "@medusajs/framework/utils";
33

4-
/**
5-
* GET /admin/statistics/alerts/:id/logs
6-
* Get alert logs for a specific alert
7-
*/
4+
85
export async function GET(
96
req: MedusaRequest,
107
res: MedusaResponse

src/api/admin/statistics/alerts/[id]/route.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import { STATISTICS_MODULE } from "../../../../../modules/statistics";
44
import StatisticsService from "../../../../../modules/statistics/service";
55
import type { UpdateAlertInput } from "../../../../validation/statistics/schemas";
66

7-
/**
8-
* GET /admin/statistics/alerts/:id
9-
* Get a specific alert
10-
*/
117
export async function GET(
128
req: MedusaRequest,
139
res: MedusaResponse
@@ -26,10 +22,6 @@ export async function GET(
2622
res.json({ alert: alerts[0] });
2723
}
2824

29-
/**
30-
* POST /admin/statistics/alerts/:id
31-
* Update an alert
32-
*/
3325
export async function POST(
3426
req: MedusaRequest<UpdateAlertInput>,
3527
res: MedusaResponse

src/api/admin/statistics/alerts/[id]/toggle/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
22
import { STATISTICS_MODULE } from "../../../../../../modules/statistics";
33
import StatisticsService from "../../../../../../modules/statistics/service";
44

5-
/**
6-
* POST /admin/statistics/alerts/:id/toggle
7-
* Toggle alert enabled status
8-
*/
95
export async function POST(
106
req: MedusaRequest,
117
res: MedusaResponse

src/api/admin/statistics/alerts/route.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import { STATISTICS_MODULE } from "../../../../modules/statistics";
44
import { createAlertWorkflow } from "../../../../workflows/statistics";
55
import type { CreateAlertInput, ListAlertsQuery } from "../../../validation/statistics/schemas";
66

7-
/**
8-
* GET /admin/statistics/alerts
9-
* List all alerts
10-
*/
117
export async function GET(
128
req: MedusaRequest<ListAlertsQuery>,
139
res: MedusaResponse
@@ -74,10 +70,7 @@ export async function GET(
7470
});
7571
}
7672

77-
/**
78-
* POST /admin/statistics/alerts
79-
* Create a new alert
80-
*/
73+
8174
export async function POST(
8275
req: MedusaRequest<CreateAlertInput>,
8376
res: MedusaResponse

src/api/admin/statistics/charts/[id]/route.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import { ContainerRegistrationKeys } from "@medusajs/framework/utils";
33
import { updateChartWorkflow, deleteChartWorkflow, type UpdateChartInput } from "../../../../../workflows/statistics";
44
import type { UpdateChartInput as UpdateChartBodyInput } from "../../../../validation/statistics/schemas";
55

6-
/**
7-
* GET /admin/statistics/charts/:id
8-
* Get a specific chart
9-
*/
6+
107
export async function GET(
118
req: MedusaRequest,
129
res: MedusaResponse
@@ -25,10 +22,7 @@ export async function GET(
2522
res.json({ chart: charts[0] });
2623
}
2724

28-
/**
29-
* POST /admin/statistics/charts/:id
30-
* Update a chart
31-
*/
25+
3226
export async function POST(
3327
req: MedusaRequest<UpdateChartBodyInput>,
3428
res: MedusaResponse
@@ -43,10 +37,7 @@ export async function POST(
4337
res.json({ chart: result });
4438
}
4539

46-
/**
47-
* DELETE /admin/statistics/charts/:id
48-
* Delete a chart
49-
*/
40+
5041
export async function DELETE(
5142
req: MedusaRequest,
5243
res: MedusaResponse

src/api/admin/statistics/charts/[id]/statistics/route.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
22
import { manageChartStatisticsWorkflow } from "../../../../../../workflows/statistics";
33

4-
/**
5-
* PUT /admin/statistics/charts/:id/statistics
6-
* Add statistics to a chart
7-
*/
4+
85
export async function PUT(
96
req: MedusaRequest<{ statistic_ids: string[] }>,
107
res: MedusaResponse
@@ -24,10 +21,7 @@ export async function PUT(
2421
});
2522
}
2623

27-
/**
28-
* DELETE /admin/statistics/charts/:id/statistics
29-
* Remove statistics from a chart
30-
*/
24+
3125
export async function DELETE(
3226
req: MedusaRequest<{ statistic_ids: string[] }>,
3327
res: MedusaResponse

src/api/admin/statistics/options/[id]/calculate/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
22
import { calculateSingleStatisticWorkflow } from "../../../../../../workflows/statistics";
33
import type { CalculateOptionInput } from "../../../../../validation/statistics/schemas";
44

5-
/**
6-
* POST /admin/statistics/options/:id/calculate
7-
* Calculate a single statistic
8-
*/
5+
96
export async function POST(
107
req: MedusaRequest<CalculateOptionInput>,
118
res: MedusaResponse

src/api/admin/statistics/options/[id]/clone/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import { STATISTICS_MODULE } from "../../../../../../modules/statistics";
33
import StatisticsService from "../../../../../../modules/statistics/service";
44
import type { CloneOptionInput } from "../../../../../validation/statistics/schemas";
55

6-
/**
7-
* POST /admin/statistics/options/:id/clone
8-
* Clone a statistics option with customizations
9-
*/
6+
107
export async function POST(
118
req: AuthenticatedMedusaRequest<CloneOptionInput>,
129
res: MedusaResponse

0 commit comments

Comments
 (0)