rhythia-api 183.0.0 → 184.0.0
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/.prettierrc.json +6 -6
- package/api/addCollectionMap.ts +82 -82
- package/api/approveMap.ts +78 -78
- package/api/chartPublicStats.ts +32 -32
- package/api/createBeatmap.ts +168 -168
- package/api/createBeatmapPage.ts +64 -64
- package/api/createClan.ts +81 -81
- package/api/createCollection.ts +58 -58
- package/api/deleteBeatmapPage.ts +77 -77
- package/api/deleteCollection.ts +59 -59
- package/api/deleteCollectionMap.ts +71 -71
- package/api/editAboutMe.ts +91 -91
- package/api/editClan.ts +90 -90
- package/api/editCollection.ts +77 -77
- package/api/editProfile.ts +123 -123
- package/api/getAvatarUploadUrl.ts +85 -85
- package/api/getBadgedUsers.ts +56 -56
- package/api/getBeatmapComments.ts +57 -57
- package/api/getBeatmapPage.ts +106 -106
- package/api/getBeatmapPageById.ts +99 -99
- package/api/getBeatmapStarRating.ts +53 -53
- package/api/getBeatmaps.ts +159 -159
- package/api/getClan.ts +77 -77
- package/api/getCollection.ts +130 -130
- package/api/getCollections.ts +126 -128
- package/api/getLeaderboard.ts +136 -136
- package/api/getMapUploadUrl.ts +93 -93
- package/api/getPassToken.ts +55 -55
- package/api/getProfile.ts +146 -146
- package/api/getPublicStats.ts +180 -180
- package/api/getRawStarRating.ts +57 -57
- package/api/getScore.ts +85 -85
- package/api/getTimestamp.ts +23 -23
- package/api/getUserScores.ts +175 -175
- package/api/nominateMap.ts +82 -82
- package/api/postBeatmapComment.ts +59 -59
- package/api/rankMapsArchive.ts +64 -64
- package/api/searchUsers.ts +56 -56
- package/api/setPasskey.ts +59 -59
- package/api/submitScore.ts +433 -433
- package/api/updateBeatmapPage.ts +229 -229
- package/handleApi.ts +22 -20
- package/index.html +2 -2
- package/index.ts +864 -865
- package/package-lock.json +8913 -0
- package/package.json +2 -2
- package/types/database.ts +0 -39
- package/utils/getUserBySession.ts +48 -48
- package/utils/requestUtils.ts +87 -87
- package/utils/security.ts +20 -20
- package/utils/star-calc/index.ts +72 -72
- package/utils/star-calc/osuUtils.ts +53 -53
- package/utils/star-calc/sspmParser.ts +398 -398
- package/utils/star-calc/sspmv1Parser.ts +165 -165
- package/utils/supabase.ts +13 -13
- package/utils/test +4 -4
- package/utils/validateToken.ts +7 -7
- package/vercel.json +12 -12
package/api/getCollection.ts
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
import z from "zod";
|
|
3
|
-
import { protectedApi } from "../utils/requestUtils";
|
|
4
|
-
import { supabase } from "../utils/supabase";
|
|
5
|
-
|
|
6
|
-
export const Schema = {
|
|
7
|
-
input: z.strictObject({
|
|
8
|
-
session: z.string(),
|
|
9
|
-
collection: z.number(),
|
|
10
|
-
}),
|
|
11
|
-
output: z.object({
|
|
12
|
-
collection: z.object({
|
|
13
|
-
title: z.string(),
|
|
14
|
-
description: z.string(),
|
|
15
|
-
owner: z.object({
|
|
16
|
-
id: z.number(),
|
|
17
|
-
username: z.string(),
|
|
18
|
-
}),
|
|
19
|
-
isList: z.boolean(),
|
|
20
|
-
beatmaps: z.array(
|
|
21
|
-
z.object({
|
|
22
|
-
id: z.number(),
|
|
23
|
-
playcount: z.number().nullable().optional(),
|
|
24
|
-
created_at: z.string().nullable().optional(),
|
|
25
|
-
difficulty: z.number().nullable().optional(),
|
|
26
|
-
length: z.number().nullable().optional(),
|
|
27
|
-
title: z.string().nullable().optional(),
|
|
28
|
-
ranked: z.boolean().nullable().optional(),
|
|
29
|
-
beatmapFile: z.string().nullable().optional(),
|
|
30
|
-
image: z.string().nullable().optional(),
|
|
31
|
-
starRating: z.number().nullable().optional(),
|
|
32
|
-
owner: z.number().nullable().optional(),
|
|
33
|
-
ownerUsername: z.string().nullable().optional(),
|
|
34
|
-
status: z.string().nullable().optional(),
|
|
35
|
-
tags: z.string().nullable().optional(),
|
|
36
|
-
})
|
|
37
|
-
),
|
|
38
|
-
}),
|
|
39
|
-
error: z.string().optional(),
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export async function POST(request: Request) {
|
|
44
|
-
return protectedApi({
|
|
45
|
-
request,
|
|
46
|
-
schema: Schema,
|
|
47
|
-
authorization: () => {},
|
|
48
|
-
activity: handler,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export async function handler(data: (typeof Schema)["input"]["_type"]) {
|
|
53
|
-
let { data: queryCollectionData, error: collectionError } = await supabase
|
|
54
|
-
.from("beatmapCollections")
|
|
55
|
-
.select(
|
|
56
|
-
`
|
|
57
|
-
*,
|
|
58
|
-
profiles!inner(
|
|
59
|
-
id,
|
|
60
|
-
username
|
|
61
|
-
)
|
|
62
|
-
`
|
|
63
|
-
)
|
|
64
|
-
.eq("id", data.collection)
|
|
65
|
-
.single();
|
|
66
|
-
|
|
67
|
-
if (!queryCollectionData) {
|
|
68
|
-
return NextResponse.json({ error: "Can't find collection" });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
let { data: queryBeatmaps, error: beatmapsError } = await supabase
|
|
72
|
-
.from("collectionRelations")
|
|
73
|
-
.select(
|
|
74
|
-
`
|
|
75
|
-
*,
|
|
76
|
-
beatmapPages!inner(
|
|
77
|
-
owner,
|
|
78
|
-
created_at,
|
|
79
|
-
id,
|
|
80
|
-
status,
|
|
81
|
-
tags,
|
|
82
|
-
beatmaps!inner(
|
|
83
|
-
playcount,
|
|
84
|
-
ranked,
|
|
85
|
-
beatmapFile,
|
|
86
|
-
image,
|
|
87
|
-
starRating,
|
|
88
|
-
difficulty,
|
|
89
|
-
length,
|
|
90
|
-
title
|
|
91
|
-
),
|
|
92
|
-
profiles!inner(
|
|
93
|
-
username
|
|
94
|
-
)
|
|
95
|
-
)
|
|
96
|
-
`
|
|
97
|
-
)
|
|
98
|
-
.eq("collection", data.collection);
|
|
99
|
-
|
|
100
|
-
const formattedBeatmaps =
|
|
101
|
-
queryBeatmaps?.map((relation) => ({
|
|
102
|
-
id: relation.beatmapPages.id,
|
|
103
|
-
playcount: relation.beatmapPages.beatmaps.playcount,
|
|
104
|
-
created_at: relation.beatmapPages.created_at,
|
|
105
|
-
difficulty: relation.beatmapPages.beatmaps.difficulty,
|
|
106
|
-
length: relation.beatmapPages.beatmaps.length,
|
|
107
|
-
title: relation.beatmapPages.beatmaps.title,
|
|
108
|
-
ranked: relation.beatmapPages.beatmaps.ranked,
|
|
109
|
-
beatmapFile: relation.beatmapPages.beatmaps.beatmapFile,
|
|
110
|
-
image: relation.beatmapPages.beatmaps.image,
|
|
111
|
-
starRating: relation.beatmapPages.beatmaps.starRating,
|
|
112
|
-
owner: relation.beatmapPages.owner,
|
|
113
|
-
ownerUsername: relation.beatmapPages.profiles.username,
|
|
114
|
-
status: relation.beatmapPages.status,
|
|
115
|
-
tags: relation.beatmapPages.tags,
|
|
116
|
-
})) || [];
|
|
117
|
-
|
|
118
|
-
return NextResponse.json({
|
|
119
|
-
collection: {
|
|
120
|
-
owner: {
|
|
121
|
-
username: queryCollectionData.profiles.username,
|
|
122
|
-
id: queryCollectionData.profiles.id,
|
|
123
|
-
},
|
|
124
|
-
isList: queryCollectionData.is_list,
|
|
125
|
-
title: queryCollectionData.title,
|
|
126
|
-
description: queryCollectionData.description,
|
|
127
|
-
beatmaps: formattedBeatmaps,
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
}
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { protectedApi } from "../utils/requestUtils";
|
|
4
|
+
import { supabase } from "../utils/supabase";
|
|
5
|
+
|
|
6
|
+
export const Schema = {
|
|
7
|
+
input: z.strictObject({
|
|
8
|
+
session: z.string(),
|
|
9
|
+
collection: z.number(),
|
|
10
|
+
}),
|
|
11
|
+
output: z.object({
|
|
12
|
+
collection: z.object({
|
|
13
|
+
title: z.string(),
|
|
14
|
+
description: z.string(),
|
|
15
|
+
owner: z.object({
|
|
16
|
+
id: z.number(),
|
|
17
|
+
username: z.string(),
|
|
18
|
+
}),
|
|
19
|
+
isList: z.boolean(),
|
|
20
|
+
beatmaps: z.array(
|
|
21
|
+
z.object({
|
|
22
|
+
id: z.number(),
|
|
23
|
+
playcount: z.number().nullable().optional(),
|
|
24
|
+
created_at: z.string().nullable().optional(),
|
|
25
|
+
difficulty: z.number().nullable().optional(),
|
|
26
|
+
length: z.number().nullable().optional(),
|
|
27
|
+
title: z.string().nullable().optional(),
|
|
28
|
+
ranked: z.boolean().nullable().optional(),
|
|
29
|
+
beatmapFile: z.string().nullable().optional(),
|
|
30
|
+
image: z.string().nullable().optional(),
|
|
31
|
+
starRating: z.number().nullable().optional(),
|
|
32
|
+
owner: z.number().nullable().optional(),
|
|
33
|
+
ownerUsername: z.string().nullable().optional(),
|
|
34
|
+
status: z.string().nullable().optional(),
|
|
35
|
+
tags: z.string().nullable().optional(),
|
|
36
|
+
})
|
|
37
|
+
),
|
|
38
|
+
}),
|
|
39
|
+
error: z.string().optional(),
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export async function POST(request: Request) {
|
|
44
|
+
return protectedApi({
|
|
45
|
+
request,
|
|
46
|
+
schema: Schema,
|
|
47
|
+
authorization: () => {},
|
|
48
|
+
activity: handler,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function handler(data: (typeof Schema)["input"]["_type"]) {
|
|
53
|
+
let { data: queryCollectionData, error: collectionError } = await supabase
|
|
54
|
+
.from("beatmapCollections")
|
|
55
|
+
.select(
|
|
56
|
+
`
|
|
57
|
+
*,
|
|
58
|
+
profiles!inner(
|
|
59
|
+
id,
|
|
60
|
+
username
|
|
61
|
+
)
|
|
62
|
+
`
|
|
63
|
+
)
|
|
64
|
+
.eq("id", data.collection)
|
|
65
|
+
.single();
|
|
66
|
+
|
|
67
|
+
if (!queryCollectionData) {
|
|
68
|
+
return NextResponse.json({ error: "Can't find collection" });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let { data: queryBeatmaps, error: beatmapsError } = await supabase
|
|
72
|
+
.from("collectionRelations")
|
|
73
|
+
.select(
|
|
74
|
+
`
|
|
75
|
+
*,
|
|
76
|
+
beatmapPages!inner(
|
|
77
|
+
owner,
|
|
78
|
+
created_at,
|
|
79
|
+
id,
|
|
80
|
+
status,
|
|
81
|
+
tags,
|
|
82
|
+
beatmaps!inner(
|
|
83
|
+
playcount,
|
|
84
|
+
ranked,
|
|
85
|
+
beatmapFile,
|
|
86
|
+
image,
|
|
87
|
+
starRating,
|
|
88
|
+
difficulty,
|
|
89
|
+
length,
|
|
90
|
+
title
|
|
91
|
+
),
|
|
92
|
+
profiles!inner(
|
|
93
|
+
username
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
`
|
|
97
|
+
)
|
|
98
|
+
.eq("collection", data.collection);
|
|
99
|
+
|
|
100
|
+
const formattedBeatmaps =
|
|
101
|
+
queryBeatmaps?.map((relation) => ({
|
|
102
|
+
id: relation.beatmapPages.id,
|
|
103
|
+
playcount: relation.beatmapPages.beatmaps.playcount,
|
|
104
|
+
created_at: relation.beatmapPages.created_at,
|
|
105
|
+
difficulty: relation.beatmapPages.beatmaps.difficulty,
|
|
106
|
+
length: relation.beatmapPages.beatmaps.length,
|
|
107
|
+
title: relation.beatmapPages.beatmaps.title,
|
|
108
|
+
ranked: relation.beatmapPages.beatmaps.ranked,
|
|
109
|
+
beatmapFile: relation.beatmapPages.beatmaps.beatmapFile,
|
|
110
|
+
image: relation.beatmapPages.beatmaps.image,
|
|
111
|
+
starRating: relation.beatmapPages.beatmaps.starRating,
|
|
112
|
+
owner: relation.beatmapPages.owner,
|
|
113
|
+
ownerUsername: relation.beatmapPages.profiles.username,
|
|
114
|
+
status: relation.beatmapPages.status,
|
|
115
|
+
tags: relation.beatmapPages.tags,
|
|
116
|
+
})) || [];
|
|
117
|
+
|
|
118
|
+
return NextResponse.json({
|
|
119
|
+
collection: {
|
|
120
|
+
owner: {
|
|
121
|
+
username: queryCollectionData.profiles.username,
|
|
122
|
+
id: queryCollectionData.profiles.id,
|
|
123
|
+
},
|
|
124
|
+
isList: queryCollectionData.is_list,
|
|
125
|
+
title: queryCollectionData.title,
|
|
126
|
+
description: queryCollectionData.description,
|
|
127
|
+
beatmaps: formattedBeatmaps,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
package/api/getCollections.ts
CHANGED
|
@@ -1,128 +1,126 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
import z from "zod";
|
|
3
|
-
import { protectedApi } from "../utils/requestUtils";
|
|
4
|
-
import { supabase } from "../utils/supabase";
|
|
5
|
-
|
|
6
|
-
export const Schema = {
|
|
7
|
-
input: z.strictObject({
|
|
8
|
-
session: z.string(),
|
|
9
|
-
page: z.number().optional().default(1),
|
|
10
|
-
itemsPerPage: z.number().optional().default(10),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
{ stars:
|
|
103
|
-
{ stars:
|
|
104
|
-
{ stars:
|
|
105
|
-
{ stars:
|
|
106
|
-
{ stars:
|
|
107
|
-
{ stars:
|
|
108
|
-
{ stars:
|
|
109
|
-
{ stars:
|
|
110
|
-
{ stars:
|
|
111
|
-
{ stars:
|
|
112
|
-
{ stars:
|
|
113
|
-
{ stars:
|
|
114
|
-
{ stars:
|
|
115
|
-
{ stars:
|
|
116
|
-
{ stars:
|
|
117
|
-
{ stars:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
128
|
-
}
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { protectedApi } from "../utils/requestUtils";
|
|
4
|
+
import { supabase } from "../utils/supabase";
|
|
5
|
+
|
|
6
|
+
export const Schema = {
|
|
7
|
+
input: z.strictObject({
|
|
8
|
+
session: z.string(),
|
|
9
|
+
page: z.number().optional().default(1),
|
|
10
|
+
itemsPerPage: z.number().optional().default(10),
|
|
11
|
+
}),
|
|
12
|
+
output: z.object({
|
|
13
|
+
collections: z.array(
|
|
14
|
+
z.object({
|
|
15
|
+
id: z.number(),
|
|
16
|
+
title: z.string(),
|
|
17
|
+
description: z.string(),
|
|
18
|
+
owner: z.number(),
|
|
19
|
+
ownerUsername: z.string(),
|
|
20
|
+
ownerAvatarUrl: z.string(),
|
|
21
|
+
beatmapCount: z.number(),
|
|
22
|
+
starRatingDistribution: z.array(
|
|
23
|
+
z.object({
|
|
24
|
+
stars: z.number(),
|
|
25
|
+
count: z.number(),
|
|
26
|
+
})
|
|
27
|
+
),
|
|
28
|
+
createdAt: z.string(),
|
|
29
|
+
})
|
|
30
|
+
),
|
|
31
|
+
totalPages: z.number(),
|
|
32
|
+
error: z.string().optional(),
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export async function POST(request: Request) {
|
|
37
|
+
return protectedApi({
|
|
38
|
+
request,
|
|
39
|
+
schema: Schema,
|
|
40
|
+
authorization: () => {},
|
|
41
|
+
activity: handler,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export async function handler(data: (typeof Schema)["input"]["_type"]) {
|
|
46
|
+
const { data: collections, error } = await supabase
|
|
47
|
+
.rpc("get_collections_v2", {
|
|
48
|
+
page_number: data.page,
|
|
49
|
+
items_per_page: data.itemsPerPage,
|
|
50
|
+
})
|
|
51
|
+
.returns<
|
|
52
|
+
{
|
|
53
|
+
id: number;
|
|
54
|
+
title: string;
|
|
55
|
+
description: string;
|
|
56
|
+
created_at: string;
|
|
57
|
+
owner: number;
|
|
58
|
+
owner_username: string;
|
|
59
|
+
owner_avatar_url: string;
|
|
60
|
+
beatmap_count: number;
|
|
61
|
+
star1: number;
|
|
62
|
+
star2: number;
|
|
63
|
+
star3: number;
|
|
64
|
+
star4: number;
|
|
65
|
+
star5: number;
|
|
66
|
+
star6: number;
|
|
67
|
+
star7: number;
|
|
68
|
+
star8: number;
|
|
69
|
+
star9: number;
|
|
70
|
+
star10: number;
|
|
71
|
+
star11: number;
|
|
72
|
+
star12: number;
|
|
73
|
+
star13: number;
|
|
74
|
+
star14: number;
|
|
75
|
+
star15: number;
|
|
76
|
+
star16: number;
|
|
77
|
+
star17: number;
|
|
78
|
+
star18: number;
|
|
79
|
+
total_pages: number;
|
|
80
|
+
}[]
|
|
81
|
+
>();
|
|
82
|
+
|
|
83
|
+
if (error) {
|
|
84
|
+
return NextResponse.json({ error });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Get the total pages from the first row (all rows will have the same value)
|
|
88
|
+
const totalPages = collections?.[0]?.total_pages ?? 1;
|
|
89
|
+
|
|
90
|
+
const formattedCollections =
|
|
91
|
+
collections?.map((collection) => ({
|
|
92
|
+
id: collection.id,
|
|
93
|
+
title: collection.title,
|
|
94
|
+
description: collection.description,
|
|
95
|
+
owner: collection.owner,
|
|
96
|
+
ownerUsername: collection.owner_username,
|
|
97
|
+
ownerAvatarUrl: collection.owner_avatar_url,
|
|
98
|
+
beatmapCount: collection.beatmap_count,
|
|
99
|
+
starRatingDistribution: [
|
|
100
|
+
{ stars: 1, count: collection.star1 },
|
|
101
|
+
{ stars: 2, count: collection.star2 },
|
|
102
|
+
{ stars: 3, count: collection.star3 },
|
|
103
|
+
{ stars: 4, count: collection.star4 },
|
|
104
|
+
{ stars: 5, count: collection.star5 },
|
|
105
|
+
{ stars: 6, count: collection.star6 },
|
|
106
|
+
{ stars: 7, count: collection.star7 },
|
|
107
|
+
{ stars: 8, count: collection.star8 },
|
|
108
|
+
{ stars: 9, count: collection.star9 },
|
|
109
|
+
{ stars: 10, count: collection.star10 },
|
|
110
|
+
{ stars: 11, count: collection.star11 },
|
|
111
|
+
{ stars: 12, count: collection.star12 },
|
|
112
|
+
{ stars: 13, count: collection.star13 },
|
|
113
|
+
{ stars: 14, count: collection.star14 },
|
|
114
|
+
{ stars: 15, count: collection.star15 },
|
|
115
|
+
{ stars: 16, count: collection.star16 },
|
|
116
|
+
{ stars: 17, count: collection.star17 },
|
|
117
|
+
{ stars: 18, count: collection.star18 },
|
|
118
|
+
],
|
|
119
|
+
createdAt: collection.created_at,
|
|
120
|
+
})) || [];
|
|
121
|
+
|
|
122
|
+
return NextResponse.json({
|
|
123
|
+
collections: formattedCollections,
|
|
124
|
+
totalPages,
|
|
125
|
+
});
|
|
126
|
+
}
|