-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1842 - add missing field title and relationship - send post
- Loading branch information
Showing
9 changed files
with
213 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { CampaignTypeCategory } from 'components/common/campaign-types/categories' | ||
|
||
export class CreateCampaignApplicationInput { | ||
/** | ||
* What would the campaign be called. ('Help Vesko' or 'Castrate Plovdiv Cats') | ||
*/ | ||
campaignName: string | ||
|
||
/** user needs to agree to this as a prerequisite to creating a campaign application */ | ||
acceptTermsAndConditions: boolean | ||
|
||
/** user needs to agree to this as a prerequisite to creating a campaign application */ | ||
transparencyTermsAccepted: boolean | ||
|
||
/** user needs to agree to this as a prerequisite to creating a campaign application */ | ||
personalInformationProcessingAccepted: boolean | ||
|
||
/** Who is organizing this campaign */ | ||
organizerName: string | ||
|
||
/** Contact Email to use for the Campaign Application process i.e. if more documents or other info are requested */ | ||
organizerEmail: string | ||
|
||
/** Contact Email to use for the Campaign Application process i.e. if more documents or other info are requested */ | ||
organizerPhone: string | ||
|
||
/** Who will benefit and use the collected donations */ | ||
beneficiary: string | ||
|
||
/** What is the relationship between the Organizer and the Beneficiary ('They're my elderly relative and I'm helping with the internet-computer stuff') */ | ||
organizerBeneficiaryRel: string | ||
|
||
/** What is the result that the collected donations will help achieve */ | ||
goal: string | ||
|
||
/** What if anything has been done so far */ | ||
history?: string | ||
|
||
/** How much would the campaign be looking for i.e '10000lv or 5000 Eur or $5000' */ | ||
amount: string | ||
|
||
/** Describe the goal of the campaign in more details */ | ||
description?: string | ||
|
||
/** Describe public figures that will back the campaign and help popularize it. */ | ||
campaignGuarantee?: string | ||
|
||
/** If any - describe what other sources were used to gather funds for the goal */ | ||
otherFinanceSources?: string | ||
|
||
/** Anything that the operator needs to know about the campaign */ | ||
otherNotes?: string | ||
|
||
category?: CampaignTypeCategory | ||
} | ||
|
||
export type CreateCampaignApplicationResponse = CreateCampaignApplicationInput & { | ||
id: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { AxiosResponse } from 'axios' | ||
import { useSession } from 'next-auth/react' | ||
|
||
import { apiClient } from 'service/apiClient' | ||
import { endpoints } from 'service/apiEndpoints' | ||
import { authConfig } from 'service/restRequests' | ||
import { | ||
CreateCampaignApplicationInput, | ||
CreateCampaignApplicationResponse, | ||
} from 'gql/campaign-applications' | ||
|
||
export const useCreateCampaignApplication = () => { | ||
const { data: session } = useSession() | ||
return async (data: CreateCampaignApplicationInput) => | ||
await apiClient.post< | ||
CreateCampaignApplicationInput, | ||
AxiosResponse<CreateCampaignApplicationResponse> | ||
>(endpoints.campaignApplication.create.url, data, authConfig(session?.accessToken)) | ||
} |