Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/OpportunityCards/OpportunityCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function OpportunityCards() {

{selectedTabIndex === 0 ? (
<Cards
url={`${urlApiOpportunity}/legacy`}
url={`${urlApiOpportunity}`}
opportunityParams={{
search: {
status: ["Volunteers Needed", "Search in process"],
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/AddOpportunity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function AddOpportunity() {
const { postRequest } = usePostRequest<
OpportunityParsedData,
Record<string, string | string[]>
>({ url: `${urlApi}/api/opportunity/legacy` });
>({ url: `${urlApi}/api/opportunity/` });

const formOpportunity = useForm<OpportunityData>({
defaultValues: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/BecomeVolunteer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function BecomeVolunteer() {
const { postRequest } = usePostRequest<
VolunteerParsedData,
Record<string, string | string[]>
>({ url: `${urlApi}/api/volunteer/legacy` });
>({ url: `${urlApi}/api/volunteer/` });

const opportunity: OpportunityInfo = {
id: opportunityParams.get("id") || "",
Expand Down
18 changes: 10 additions & 8 deletions src/components/forms/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { Lang } from "need4deed-sdk";
import { useTranslation } from "react-i18next";
import { getExternalUrl } from "../../utils";
import AddOpportunity from "./AddOpportunity";
import BecomeVolunteer from "./BecomeVolunteer";
import { FormType } from "./types";

interface Props {
form: FormType;
}

export default function Form({ form }: Props) {
const { i18n } = useTranslation();

const to = getExternalUrl(i18n.language as Lang, form);
window.location.replace(to);
return null;
switch (form) {
case FormType.VOLUNTEER:
return <BecomeVolunteer />;
case FormType.OPPORTUNITY:
return <AddOpportunity />;
default:
return null;
}
}
Loading