mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-24 19:31:03 +00:00
feat: update with user endpoint changes
This commit is contained in:
@@ -15,16 +15,16 @@ export const downloadSourceSchema = z.object({
|
||||
|
||||
const gamesArray = z.array(
|
||||
z.object({
|
||||
id: z.number(),
|
||||
id: z.string().length(8),
|
||||
objectId: z.string().max(255),
|
||||
playTimeInMilliseconds: z.number().int(),
|
||||
playTimeInSeconds: z.number().int(),
|
||||
shop: z.enum(["steam", "epic"]),
|
||||
lastTimePlayed: z.coerce.date().nullable(),
|
||||
})
|
||||
);
|
||||
|
||||
export const userProfileSchema = z.object({
|
||||
username: z.string(),
|
||||
displayName: z.string(),
|
||||
libraryGames: gamesArray,
|
||||
recentGames: gamesArray,
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ const getUserProfile = async (
|
||||
username: string
|
||||
): Promise<UserProfile | null> => {
|
||||
try {
|
||||
const response = await HydraApi.get(`/profile/${username}`);
|
||||
const response = await HydraApi.get(`/user/${username}`);
|
||||
const profile = userProfileSchema.parse(response.data);
|
||||
|
||||
const recentGames = await Promise.all(
|
||||
|
||||
Reference in New Issue
Block a user