Skip to content

Commit

Permalink
refactor: fixed typos in BookmarkTypes (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamtschatka authored Jul 1, 2024
1 parent 9cd6170 commit 4e70fe3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function UpdatingBookmarkList({
<BookmarkList
bookmarks={data.pages
.flatMap((p) => p.bookmarks)
.filter((b) => b.content.type != BookmarkTypes.UNKNWON)}
.filter((b) => b.content.type != BookmarkTypes.UNKNOWN)}
header={header}
onRefresh={onRefresh}
fetchNextPage={fetchNextPage}
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/types/bookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const enum BookmarkTypes {
LINK = "link",
TEXT = "text",
ASSET = "asset",
UNKNWON = "unknown",
UNKNOWN = "unknown",
}

export const zBookmarkedLinkSchema = z.object({
Expand Down Expand Up @@ -45,7 +45,7 @@ export const zBookmarkContentSchema = z.discriminatedUnion("type", [
zBookmarkedLinkSchema,
zBookmarkedTextSchema,
zBookmarkedAssetSchema,
z.object({ type: z.literal(BookmarkTypes.UNKNWON) }),
z.object({ type: z.literal(BookmarkTypes.UNKNOWN) }),
]);
export type ZBookmarkContent = z.infer<typeof zBookmarkContentSchema>;

Expand Down
6 changes: 3 additions & 3 deletions packages/trpc/routers/bookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function toZodSchema(bookmark: BookmarkQueryReturnType): ZBookmark {
const { tagsOnBookmarks, link, text, asset, assets, ...rest } = bookmark;

let content: ZBookmarkContent = {
type: BookmarkTypes.UNKNWON,
type: BookmarkTypes.UNKNOWN,
};
switch (bookmark.type) {
case BookmarkTypes.LINK:
Expand Down Expand Up @@ -230,7 +230,7 @@ export const bookmarksAppRouter = router({
return { ...alreadyExists, alreadyExists: true };
}
}
if (input.type == BookmarkTypes.UNKNWON) {
if (input.type == BookmarkTypes.UNKNOWN) {
throw new TRPCError({ code: "BAD_REQUEST" });
}
const bookmark = await ctx.db.transaction(async (tx) => {
Expand Down Expand Up @@ -603,7 +603,7 @@ export const bookmarksAppRouter = router({

if (
row.bookmarkTags &&
// Duplicates may accur because of the join, so we need to make sure we're not adding the same tag twice
// Duplicates may occur because of the join, so we need to make sure we're not adding the same tag twice
!acc[bookmarkId].tags.some((t) => t.id == row.bookmarkTags!.id)
) {
invariant(
Expand Down

0 comments on commit 4e70fe3

Please sign in to comment.