fix status page reset password

This commit is contained in:
Simon Larsen 2023-09-26 11:06:59 +01:00
parent ee1ec87781
commit a70e98f802
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
3 changed files with 16 additions and 3 deletions

View File

@ -118,7 +118,7 @@ const ModelForm: <TBaseModel extends BaseModel>(
? (Object.keys(field.field)[0] as string)
: null;
if (key && hasPermissionOnField(key)) {
if (key && (hasPermissionOnField(key) || field.forceShow)) {
(select as Dictionary<boolean>)[key] = true;
}
}

View File

@ -38,6 +38,10 @@ router.post(
try {
const data: JSONObject = req.body['data'];
if (!data['email']) {
throw new BadDataException('Email is required.');
}
const user: StatusPagePrivateUser = JSONFunctions.fromJSON(
data as JSONObject,
StatusPagePrivateUser
@ -164,7 +168,13 @@ router.post(
next: NextFunction
): Promise<void> => {
try {
const data: JSONObject = req.body['data'];
const data: JSONObject = JSONFunctions.deserialize(
req.body['data']
);
if (!data['statusPageId']) {
throw new BadDataException('Status Page ID is required.');
}
const user: StatusPagePrivateUser = JSONFunctions.fromJSON(
data as JSONObject,
@ -207,7 +217,7 @@ router.post(
const statusPage: StatusPage | null =
await StatusPageService.findOneById({
id: new ObjectID(data['statusPageId'] as string),
id: new ObjectID(data['statusPageId'].toString()),
props: {
isRoot: true,
ignoreHooks: true,

View File

@ -110,6 +110,9 @@ const ResetPassword: FunctionComponent<ComponentProps> = (
?.toString()
.replace('/', '')
.toString() || '';
item.statusPageId =
StatusPageUtil.getStatusPageId()!;
return Promise.resolve(item);
}}
showAsColumns={1}