diff --git a/common/contract.ts b/common/contract.ts index 419e279d..9b9d428d 100644 --- a/common/contract.ts +++ b/common/contract.ts @@ -5,6 +5,7 @@ export type Contract = { creatorId: string creatorName: string creatorUsername: string + creatorAvatarUrl?: string // Start requiring after Mar 01, 2022 question: string description: string // More info about what the contract is about diff --git a/common/new-contract.ts b/common/new-contract.ts index 3cd0823a..85f5dedc 100644 --- a/common/new-contract.ts +++ b/common/new-contract.ts @@ -24,6 +24,7 @@ export function getNewContract( creatorId: creator.id, creatorName: creator.name, creatorUsername: creator.username, + creatorAvatarUrl: creator.avatarUrl, question: question.trim(), description: description.trim(), diff --git a/web/lib/firebase/contracts.ts b/web/lib/firebase/contracts.ts index 6e596c32..b674296a 100644 --- a/web/lib/firebase/contracts.ts +++ b/web/lib/firebase/contracts.ts @@ -69,14 +69,6 @@ export async function updateContract( await updateDoc(docRef, update) } -export async function pushNewContract(contract: Omit) { - const newContractRef = doc(contractCollection) - const fullContract: Contract = { ...contract, id: newContractRef.id } - - await setDoc(newContractRef, fullContract) - return fullContract -} - export async function getContractFromId(contractId: string) { const docRef = doc(db, 'contracts', contractId) const result = await getDoc(docRef)