-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2449 from zetkin/release-241223
241223 Release
- Loading branch information
Showing
29 changed files
with
971 additions
and
19 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
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,29 @@ | ||
import 'leaflet/dist/leaflet.css'; | ||
import { headers } from 'next/headers'; | ||
import { redirect } from 'next/navigation'; | ||
|
||
import BackendApiClient from 'core/api/client/BackendApiClient'; | ||
import { ZetkinOrganization } from 'utils/types/zetkin'; | ||
import MyCanvassAssignmentPage from 'features/canvassAssignments/components/MyCanvassAssignmentPage'; | ||
|
||
interface PageProps { | ||
params: { | ||
canvassAssId: string; | ||
}; | ||
} | ||
|
||
export default async function Page({ params }: PageProps) { | ||
const { canvassAssId } = params; | ||
const headersList = headers(); | ||
const headersEntries = headersList.entries(); | ||
const headersObject = Object.fromEntries(headersEntries); | ||
const apiClient = new BackendApiClient(headersObject); | ||
|
||
try { | ||
await apiClient.get<ZetkinOrganization>(`/api/users/me`); | ||
|
||
return <MyCanvassAssignmentPage canvassAssId={canvassAssId} />; | ||
} catch (err) { | ||
return redirect(`/login?redirect=/canvass/${canvassAssId}/map`); | ||
} | ||
} |
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,29 @@ | ||
import { headers } from 'next/headers'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
import BackendApiClient from 'core/api/client/BackendApiClient'; | ||
import { ZetkinOrganization } from 'utils/types/zetkin'; | ||
import JoinFormVerifiedPage from 'features/joinForms/components/JoinFormVerifiedPage'; | ||
|
||
type PageProps = { | ||
params: { | ||
orgId: string; | ||
}; | ||
}; | ||
|
||
export default async function Page({ params }: PageProps) { | ||
const headersList = headers(); | ||
const headersEntries = headersList.entries(); | ||
const headersObject = Object.fromEntries(headersEntries); | ||
const apiClient = new BackendApiClient(headersObject); | ||
|
||
try { | ||
const org = await apiClient.get<ZetkinOrganization>( | ||
`/api/orgs/${params.orgId}` | ||
); | ||
|
||
return <JoinFormVerifiedPage org={org} />; | ||
} catch (err) { | ||
return notFound(); | ||
} | ||
} |
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
Oops, something went wrong.