feat: user

This commit is contained in:
moolcoov committed 2025-03-03 20:35:47 +03:00
1 parent 1b58e1d51e
commit f3a2f5ee23
7 files changed
+64 -9

No files matched your search

+5 -1
View File
@@ -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;
}