Skip to content
Snippets Groups Projects
Verified Commit 4a9f1080 authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Fix frontend bugs

An api path was missing a slash and a save button did not redirect back
to the previous location
parent 3034f6f5
No related branches found
No related tags found
1 merge request!160Tests/increase coverage
......@@ -69,7 +69,7 @@ export default function GuestRegister() {
const guestContactInfo = async () => {
try {
const response = await fetch('/api/ui/v1/invited')
const response = await fetch('/api/ui/v1/invited/')
if (response.ok) {
response.json().then((jsonResponse) => {
......
......@@ -20,7 +20,7 @@ import { Guest } from 'interfaces'
import { useState } from 'react'
import { Controller, useForm } from 'react-hook-form'
import { useTranslation } from 'react-i18next'
import { Link, useParams } from 'react-router-dom'
import { Link, useHistory, useParams } from 'react-router-dom'
import SponsorInfoButtons from 'routes/components/sponsorInfoButtons'
import { submitJsonOpts } from 'utils'
......@@ -103,8 +103,10 @@ function NewGuestRole({ guest }: NewGuestRoleProps) {
} = useForm<AddRoleFormData>()
const { pid } = useParams<GuestInfoParams>()
const history = useHistory()
const onSubmit = handleSubmit(() => {
postRole(getValues(), pid)
history.push(`/sponsor/guest/${pid}`)
})
const ous = useOus()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment