mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 14:27:10 +00:00
feat: user
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { userFetch } from ".";
|
||||
import { User } from "../types/user";
|
||||
import { User, UserStats } from "../types/user";
|
||||
|
||||
export const getCurrentUser = async () => {
|
||||
return await userFetch<User>("/me");
|
||||
};
|
||||
|
||||
export const getCurrentUserStats = async () => {
|
||||
return await userFetch<UserStats>("/me/stat");
|
||||
};
|
||||
|
||||
@@ -12,3 +12,8 @@ export interface Achievement {
|
||||
received_at: Date;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
export interface UserStats {
|
||||
total_attempts: number;
|
||||
solved_tasks: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user