Fix/adding manga to library not updating category (#559)

* Refetch categories after updating a manga

After adding/removing a manga to/from the library, the categories did not update.

* Include manga categories int the manga update mutation response
This commit is contained in:
schroda
2024-01-17 13:45:30 +01:00
committed by GitHub
parent e10cbf9e8f
commit 1c2a196950
2 changed files with 20 additions and 1 deletions

View File

@@ -75,6 +75,15 @@ export const UPDATE_MANGA = gql`
id id
inLibrary inLibrary
inLibraryAt inLibraryAt
categories {
nodes {
id
mangas {
totalCount
}
}
totalCount
}
} }
} }
} }
@@ -88,6 +97,15 @@ export const UPDATE_MANGAS = gql`
id id
inLibrary inLibrary
inLibraryAt inLibraryAt
categories {
nodes {
id
mangas {
totalCount
}
}
totalCount
}
} }
} }
} }

View File

@@ -1414,7 +1414,8 @@ export class RequestManager {
); );
result.response.then(() => { result.response.then(() => {
this.graphQLClient.client.cache.evict({ fieldName: 'mangas' }); this.graphQLClient.client.cache.evict({ broadcast: true, fieldName: 'categories' });
this.graphQLClient.client.cache.evict({ broadcast: true, fieldName: 'mangas' });
}); });
return result; return result;