Use env domain
This commit is contained in:
parent
043717b399
commit
356db47760
|
@ -14,12 +14,13 @@ import { useEffect, useState } from 'react'
|
||||||
import { User } from 'common/user'
|
import { User } from 'common/user'
|
||||||
import { db } from './init'
|
import { db } from './init'
|
||||||
import { Contract } from 'common/contract'
|
import { Contract } from 'common/contract'
|
||||||
|
import { ENV_CONFIG } from 'common/envs/constants'
|
||||||
|
|
||||||
export const challenges = (contractId: string) =>
|
export const challenges = (contractId: string) =>
|
||||||
coll<Challenge>(`contracts/${contractId}/challenges`)
|
coll<Challenge>(`contracts/${contractId}/challenges`)
|
||||||
|
|
||||||
export function getChallengeUrl(challenge: Challenge) {
|
export function getChallengeUrl(challenge: Challenge) {
|
||||||
return `${location.protocol}//${location.host}/challenges/${challenge.creatorUsername}/${challenge.contractSlug}/${challenge.slug}`
|
return `https://${ENV_CONFIG.domain}/challenges/${challenge.creatorUsername}/${challenge.contractSlug}/${challenge.slug}`
|
||||||
}
|
}
|
||||||
export async function createChallenge(data: {
|
export async function createChallenge(data: {
|
||||||
creator: User
|
creator: User
|
||||||
|
|
Loading…
Reference in New Issue
Block a user