mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
Fix typecheck errors
This commit is contained in:
@@ -149,9 +149,8 @@ export function useSaveCategoryMutation() {
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ category }: SaveCategoryPayload) => {
|
||||
const { grouped: categoryGroups } = await queryClient.ensureQueryData(
|
||||
categoryQueries.list(),
|
||||
);
|
||||
const { grouped: categoryGroups = [] } =
|
||||
await queryClient.ensureQueryData(categoryQueries.list());
|
||||
|
||||
const group = categoryGroups.find(g => g.id === category.group);
|
||||
const categoriesInGroup = group?.categories ?? [];
|
||||
@@ -299,7 +298,7 @@ export function useReorderCategoryMutation() {
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ id, groupId, targetId }: ReoderCategoryPayload) => {
|
||||
const { grouped: categoryGroups, list: categories } =
|
||||
const { grouped: categoryGroups = [], list: categories = [] } =
|
||||
await queryClient.ensureQueryData(categoryQueries.list());
|
||||
|
||||
const moveCandidate = categories.filter(c => c.id === id)[0];
|
||||
|
||||
Reference in New Issue
Block a user