Skip to content

Commit

Permalink
Fix new Date() issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmartineau committed Nov 9, 2023
1 parent 377a2c5 commit 8a4cd16
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/components/BookmarkForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ export const BookmarkForm = ({
} else {
await supabaseClient
.from('bookmarks')
.update({ ...formData, modified_at: new Date().toString() })
// @ts-ignore
.update({ ...formData, modified_at: new Date() })
.match({ id });
toast({
title: 'Item edited',
Expand Down
9 changes: 6 additions & 3 deletions src/components/FeedItemActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export const FeedItemActions = ({
.from('bookmarks')
.update({
status: 'inactive',
modified_at: new Date().toString(),
// @ts-ignore
modified_at: new Date(),
})
.match({ id });
}
Expand All @@ -60,7 +61,8 @@ export const FeedItemActions = ({
.from('bookmarks')
.update({
status: 'active',
modified_at: new Date().toString(),
// @ts-ignore
modified_at: new Date(),
})
.match({ id });
};
Expand All @@ -74,7 +76,8 @@ export const FeedItemActions = ({
.from('bookmarks')
.update({
star: !star,
modified_at: new Date().toString(),
// @ts-ignore
modified_at: new Date(),
})
.match({ id });
};
Expand Down
3 changes: 2 additions & 1 deletion src/components/FeedItemFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const FeedItemFooter = (props: FeedItemFooterProps) => {
.from('bookmarks')
.update({
star: !star,
modified_at: new Date().toString(),
// @ts-ignore
modified_at: new Date(),
})
.match({ id });
};
Expand Down
3 changes: 2 additions & 1 deletion src/components/UserProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export const UserProvider = ({ children, id, profile }: UserProviderProps) => {
}
await supabaseClient
.from('profiles')
.update({ [column]: value, updated_at: new Date().toString() })
// @ts-ignore
.update({ [column]: value, updated_at: new Date() })
.match({ id });
},
[id, realtimeProfile?.settings_pinned_tags, supabaseClient],
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useClickBookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const useClickBookmark = () => {
.from('bookmarks')
.update({
click_count: count + 1,
modified_at: new Date().toString(),
// @ts-ignore
modified_at: new Date(),
})
.match({ id });
};
Expand Down

0 comments on commit 8a4cd16

Please sign in to comment.