rhythia-api 95.0.0 → 97.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/api/getUserScores.ts +27 -3
- package/package.json +1 -1
package/api/getUserScores.ts
CHANGED
|
@@ -26,10 +26,28 @@ export const Schema = {
|
|
|
26
26
|
userId: z.number().nullable(),
|
|
27
27
|
beatmapDifficulty: z.number().optional().nullable(),
|
|
28
28
|
beatmapNotes: z.number().optional().nullable(),
|
|
29
|
+
beatmapTitle: z.string().optional().nullable(),
|
|
30
|
+
})
|
|
31
|
+
)
|
|
32
|
+
.optional(),
|
|
33
|
+
top: z
|
|
34
|
+
.array(
|
|
35
|
+
z.object({
|
|
36
|
+
awarded_sp: z.number().nullable(),
|
|
37
|
+
beatmapHash: z.string().nullable(),
|
|
38
|
+
created_at: z.string(),
|
|
39
|
+
id: z.number(),
|
|
40
|
+
misses: z.number().nullable(),
|
|
41
|
+
passed: z.boolean().nullable(),
|
|
42
|
+
rank: z.string().nullable(),
|
|
43
|
+
songId: z.string().nullable(),
|
|
44
|
+
userId: z.number().nullable(),
|
|
45
|
+
beatmapDifficulty: z.number().optional().nullable(),
|
|
46
|
+
beatmapNotes: z.number().optional().nullable(),
|
|
47
|
+
beatmapTitle: z.string().optional().nullable(),
|
|
29
48
|
})
|
|
30
49
|
)
|
|
31
50
|
.optional(),
|
|
32
|
-
top: z.array(z.object({})).optional(),
|
|
33
51
|
}),
|
|
34
52
|
};
|
|
35
53
|
|
|
@@ -53,11 +71,13 @@ export async function handler(
|
|
|
53
71
|
*,
|
|
54
72
|
beatmaps (
|
|
55
73
|
difficulty,
|
|
56
|
-
noteCount
|
|
74
|
+
noteCount,
|
|
75
|
+
title
|
|
57
76
|
)
|
|
58
77
|
`
|
|
59
78
|
)
|
|
60
79
|
.eq("userId", data.id)
|
|
80
|
+
.eq("passed", true)
|
|
61
81
|
.order("created_at", { ascending: false })
|
|
62
82
|
.limit(10);
|
|
63
83
|
|
|
@@ -68,12 +88,14 @@ export async function handler(
|
|
|
68
88
|
*,
|
|
69
89
|
beatmaps (
|
|
70
90
|
difficulty,
|
|
71
|
-
noteCount
|
|
91
|
+
noteCount,
|
|
92
|
+
title
|
|
72
93
|
)
|
|
73
94
|
`
|
|
74
95
|
)
|
|
75
96
|
.eq("userId", data.id)
|
|
76
97
|
.neq("awarded_sp", 0)
|
|
98
|
+
.eq("passed", true)
|
|
77
99
|
.order("awarded_sp", { ascending: false })
|
|
78
100
|
.limit(10);
|
|
79
101
|
|
|
@@ -90,6 +112,7 @@ export async function handler(
|
|
|
90
112
|
songId: s.songId,
|
|
91
113
|
beatmapDifficulty: s.beatmaps?.difficulty,
|
|
92
114
|
beatmapNotes: s.beatmaps?.noteCount,
|
|
115
|
+
beatmapTitle: s.beatmaps?.title,
|
|
93
116
|
})),
|
|
94
117
|
top: scores2?.map((s) => ({
|
|
95
118
|
created_at: s.created_at,
|
|
@@ -103,6 +126,7 @@ export async function handler(
|
|
|
103
126
|
songId: s.songId,
|
|
104
127
|
beatmapDifficulty: s.beatmaps?.difficulty,
|
|
105
128
|
beatmapNotes: s.beatmaps?.noteCount,
|
|
129
|
+
beatmapTitle: s.beatmaps?.title,
|
|
106
130
|
})),
|
|
107
131
|
});
|
|
108
132
|
}
|