Revert 4849be84
This commit is contained in:
@@ -102,15 +102,16 @@ const SignupCreatePage: NextPage = () => {
|
|||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
let id: number;
|
let id: string;
|
||||||
|
|
||||||
if (router.query?.id && router.query.id !== "create") {
|
if (router.query?.id && router.query.id !== "create") {
|
||||||
id = Number(router.query.id);
|
id = router.query.id as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!Number.isNaN(id)) {
|
const suId = id && Number(id);
|
||||||
SignupApi.getForm(id, true)
|
if (suId !== undefined) {
|
||||||
|
SignupApi.getForm(suId, true)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setFormData({
|
setFormData({
|
||||||
...res,
|
...res,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const API_URL = "https://api.dev.sahkoinsinoorikilta.fi/api";
|
|||||||
export const getSiteRoot = (): string => process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000";
|
export const getSiteRoot = (): string => process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000";
|
||||||
export const getPageUrl = ClientFunction(() => window.location.pathname);
|
export const getPageUrl = ClientFunction(() => window.location.pathname);
|
||||||
|
|
||||||
export const getPostRequestLogger = (url: string) => RequestLogger({ url: `${API_URL}/${url}`, method: "post" }, {
|
export const getPostRequestLogger = (url: string) => RequestLogger({ url: `${API_URL}/${url}`, method: "POST" }, {
|
||||||
// logResponseHeaders: true,
|
// logResponseHeaders: true,
|
||||||
logResponseBody: true,
|
logResponseBody: true,
|
||||||
stringifyResponseBody: true,
|
stringifyResponseBody: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user