feat: return user data when marking episode as watched
This commit is contained in:
@@ -2,6 +2,7 @@ import { graphql } from "gql.tada";
|
||||
import { GraphQLClient } from "graphql-request";
|
||||
|
||||
import { sleep } from "~/libs/sleep";
|
||||
import type { User } from "~/types/user";
|
||||
|
||||
const GetUserQuery = graphql(`
|
||||
query GetUser {
|
||||
@@ -23,23 +24,6 @@ const GetUserQuery = graphql(`
|
||||
}
|
||||
`);
|
||||
|
||||
type User = {
|
||||
statistics: {
|
||||
minutesWatched?: number | undefined;
|
||||
episodesWatched?: number | undefined;
|
||||
count?: number | undefined;
|
||||
meanScore?: number | undefined;
|
||||
};
|
||||
name?: string | undefined;
|
||||
avatar?:
|
||||
| {
|
||||
medium: string | null;
|
||||
large: string | null;
|
||||
}
|
||||
| null
|
||||
| undefined;
|
||||
} | null;
|
||||
|
||||
export async function getUser(aniListToken: string): Promise<User> {
|
||||
const client = new GraphQLClient("https://graphql.anilist.co/");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user