-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
68 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { useQuery } from '@tanstack/react-query' | ||
import { CampaignApplication } from 'gql/campaign-applications' | ||
import { useSession } from 'next-auth/react' | ||
import { endpoints } from 'service/apiEndpoints' | ||
import { authQueryFnFactory } from 'service/restRequests' | ||
|
||
export function useCampaignApplicationsAdminList() { | ||
const { data: session } = useSession() | ||
return useQuery<CampaignApplication[]>( | ||
[endpoints.campaignApplications.listAllAdmin.url], | ||
authQueryFnFactory<CampaignApplication[]>(session?.accessToken), | ||
) | ||
} |
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,37 @@ | ||
import { CampaignTypeCategory } from 'components/common/campaign-types/categories' | ||
|
||
export type CampaignApplicationState = | ||
| 'review' | ||
| 'requestInfo' | ||
| 'forCommitteeReview' | ||
| 'approved' | ||
| 'denied' | ||
| 'abandoned' | ||
|
||
export interface CampaignApplication { | ||
id: string | ||
createdAt: Date | ||
updatedAt: Date | null | ||
organizerId: string | null | ||
organizerName: string | ||
organizerEmail: string | null | ||
organizerPhone: string | null | ||
beneficiary: string | ||
organizerBeneficiaryRel: string | ||
campaignName: string | ||
goal: string | ||
history: string | null | ||
amount: string | ||
description: string | null | ||
documents?: object[] | ||
campaignGuarantee: string | null | ||
otherFinanceSources: string | null | ||
otherNotes: string | null | ||
state: CampaignApplicationState | ||
category: CampaignTypeCategory | null | ||
ticketURL: string | null | ||
archived: boolean | null | ||
} | ||
|
||
|
||
export type Keys = keyof CampaignApplication; |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import CampaignApplications from 'components/admin/campaign-applications/CampaignApplications' | ||
import { securedPropsWithTranslation } from 'middleware/auth/securedProps' | ||
import { securedAdminProps } from 'middleware/auth/securedProps' | ||
import { GetServerSideProps } from 'next' | ||
import { endpoints } from 'service/apiEndpoints' | ||
|
||
export const getServerSideProps: GetServerSideProps = securedPropsWithTranslation( | ||
export const getServerSideProps: GetServerSideProps = securedAdminProps( | ||
['common', 'auth', 'validation', 'campaigns', 'campaign-application'], | ||
'', | ||
() => endpoints.campaignApplications.listAllAdmin.url, | ||
) | ||
|
||
export default CampaignApplications |
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