Skip to content

Commit 32350ed

Browse files
authored
Merge pull request #95 from codewithzubair07/feature/public-creator-query-constants-87
feat: add public creator query key constants (#87)
2 parents 79fd8c3 + b44d9d4 commit 32350ed

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export const CREATOR_PUBLIC_QUERY_KEYS = {
2+
CREATOR_ID: "creatorId",
3+
CREATOR_ADDRESS: "creatorAddress",
4+
USERNAME: "username",
5+
} as const;
6+
7+
export type CreatorPublicQueryKey =
8+
(typeof CREATOR_PUBLIC_QUERY_KEYS)[keyof typeof CREATOR_PUBLIC_QUERY_KEYS];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { CREATOR_PUBLIC_QUERY_KEYS } from "../constants/creator-public-query.constants";
2+
3+
export const parseCreatorPublicQuery = (query: Record<string, any>) => {
4+
return {
5+
creatorId: query[CREATOR_PUBLIC_QUERY_KEYS.CREATOR_ID],
6+
creatorAddress: query[CREATOR_PUBLIC_QUERY_KEYS.CREATOR_ADDRESS],
7+
username: query[CREATOR_PUBLIC_QUERY_KEYS.USERNAME],
8+
};
9+
};

0 commit comments

Comments
 (0)