Skip to content

Commit

Permalink
Merge pull request #180 from cabcookie/split-notes-in-blocks
Browse files Browse the repository at this point in the history
fix: clean up
  • Loading branch information
cabcookie authored Aug 26, 2024
2 parents af75c2a + c7f5d0f commit 3289495
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 26 deletions.
2 changes: 0 additions & 2 deletions api/useActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export type ActivityData = SelectionSet<
typeof selectionSet
>;
export type NoteBlockData = ActivityData["noteBlocks"][number];
export type ActivityProjectsData = ActivityData["forProjects"][number];

export const mapActivity = (a: ActivityData): Activity => ({
id: a.id,
Expand Down Expand Up @@ -232,5 +231,4 @@ const useActivity = (activityId?: string) => {
};
};

export type MutateActivityFn = ReturnType<typeof useActivity>["mutateActivity"];
export default useActivity;
2 changes: 1 addition & 1 deletion api/useMeetingTodos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useSWR from "swr";
import { Todo } from "./useProjectTodos";
const client = generateClient<Schema>();

export type MeetingTodo = Todo & {
type MeetingTodo = Todo & {
meetingId: string;
blockId: string;
};
Expand Down
2 changes: 1 addition & 1 deletion components/planning/DailyPlanForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const DailyPlanForm: FC<DailyPlanFormProps> = ({
dailyPlan?.day ||
(getHours(new Date()) < 12 ? new Date() : addDays(new Date(), 1))
);
}, [dailyPlan, context]);
}, [dailyPlan, context, form]);

const handleSubmit = ({ date, goal }: FormValues) => {
if (!dailyPlan) {
Expand Down
1 change: 1 addition & 0 deletions components/planning/ReviewProjectForDailyPlanning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const ReviewProjectForDailyPlanning: FC<ReviewProjectForDailyPlanningProps> = ({

useEffect(() => {
filterTodos(projectTodos, dailyPlan, setFilteredTodos);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [projectTodos, dailyPlan.todos]);

const pushProject = () => {
Expand Down
11 changes: 0 additions & 11 deletions components/ui-elements/editors/helpers/blocks-cud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,6 @@ const mapLevel1 =
};
};

export const mapChangedBlocks = (
changedBlocks: TBlockUpdateSet[],
activity: Activity
) => ({
...activity,
notes: {
...activity.notes,
content: activity.notes.content?.map(mapLevel1(changedBlocks)),
},
});

export const updateBlock = async ({
blockId,
content,
Expand Down
11 changes: 0 additions & 11 deletions components/ui-elements/editors/helpers/todos-cud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,6 @@ const mapLevel1 =
content: level1.content?.map(mapLevel2(changedTodos)),
});

export const mapChangedTodos = (
changedTodos: TTodoUpdateSet[],
activity: Activity
) => ({
...activity,
notes: {
...activity.notes,
content: activity.notes.content?.map(mapLevel1(changedTodos)),
},
});

export const updateTodo = async ({ todoId, content, done }: TTodoUpdateSet) => {
const { data, errors } = await client.models.Todo.update({
id: todoId,
Expand Down

0 comments on commit 3289495

Please sign in to comment.