added diff name and setup skeleton for top recent plays
This commit is contained in:
35
components/RecentChunithmScores/action.ts
Normal file
35
components/RecentChunithmScores/action.ts
Normal file
@ -0,0 +1,35 @@
|
||||
"use server";
|
||||
|
||||
import { getAuth } from "@/auth/queries/getauth";
|
||||
import { supportedVersionNumber } from "@/lib/helpers";
|
||||
import { artemis } from "@/lib/prisma";
|
||||
|
||||
export async function getUserRecentPlays() {
|
||||
const { user } = await getAuth();
|
||||
|
||||
if (!user || !user.accessCode) {
|
||||
throw new Error("User is not authenticated or accessCode is missing");
|
||||
}
|
||||
|
||||
const userRatingBaseHotList = await artemis.chuni_profile_rating.findMany({
|
||||
where: {
|
||||
user: user.UserId,
|
||||
// userRatingBaseList recent 30 // userRatingBaseHotList recent 15
|
||||
type: "userRatingBaseList",
|
||||
version: supportedVersionNumber, // TODO: eventually change this so the user can set their own version
|
||||
},
|
||||
select: {
|
||||
score:true,
|
||||
difficultId: true,
|
||||
musicId: true,
|
||||
type:true,
|
||||
version: true,
|
||||
romVersionCode: true,
|
||||
id: true,
|
||||
index:true,
|
||||
user: true,
|
||||
|
||||
},
|
||||
});
|
||||
return userRatingBaseHotList;
|
||||
}
|
Reference in New Issue
Block a user