Skip to content

Commit

Permalink
add external id
Browse files Browse the repository at this point in the history
  • Loading branch information
terryli0095 committed May 17, 2024
1 parent 5768eab commit 8094843
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion wondrous-bot-admin/src/components/Referral/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const StartReferralPage = () => {

const {data: referralLimitReached, loading: referralLimitLoading} = useQuery(GET_REFERRAL_USER_LIMIT_REACHED, {
variables: {
referralCode
referralCode,
referralCampaignExternalId
},
skip: !referralCode
});
Expand Down
4 changes: 2 additions & 2 deletions wondrous-bot-admin/src/graphql/queries/referral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export const GET_REFERRAL_CODE_INFO = gql`
`;

export const GET_REFERRAL_USER_LIMIT_REACHED = gql`
query getReferralUserLimitReached($referralCode: String!) {
getReferralUserLimitReached(referralCode: $referralCode) {
query getReferralUserLimitReached($referralCode: String!, $referralCampaignExternalId: String!) {
getReferralUserLimitReached(referralCode: $referralCode , referralCampaignExternalId: $referralCampaignExternalId) {
hasReachedLimit
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export const getYouTubeVideoId = (url) => {
let videoId = "";
if (url?.includes("shorts")) {
// https://www.youtube.com/shorts/rKANnKDu5-o
const shortsRegex = /youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/;
const match = url.match(shortsRegex);
return match ? match[1] : null;
}
// Extract video ID from the first format: https://youtu.be/videoId
const regex1 = /^https:\/\/youtu\.be\/([^\?]+)/;
const match1 = url.match(regex1);
Expand Down

0 comments on commit 8094843

Please sign in to comment.