Fix HalRepresentationWithEmbedded type (#1793)

Fix HalRepresentationWithEmbedded type since _embedded can be null.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2021-09-02 15:47:15 +02:00
committed by GitHub
parent 0ba8300051
commit 43e1ea06c8
16 changed files with 108 additions and 106 deletions

View File

@@ -67,7 +67,7 @@ export const useChangesets = (
const key = branchQueryKey(repository, branch, "changesets", request?.page || 0);
return useQuery<ChangesetCollection, Error>(key, () => apiClient.get(link).then((response) => response.json()), {
onSuccess: (changesetCollection) => {
changesetCollection._embedded.changesets.forEach((changeset) => {
changesetCollection._embedded?.changesets.forEach((changeset) => {
queryClient.setQueryData(changesetQueryKey(repository, changeset.id), changeset);
});
},