mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 07:10:53 +00:00
fix status page reset password
This commit is contained in:
parent
ee1ec87781
commit
a70e98f802
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -110,6 +110,9 @@ const ResetPassword: FunctionComponent<ComponentProps> = (
|
||||
?.toString()
|
||||
.replace('/', '')
|
||||
.toString() || '';
|
||||
|
||||
item.statusPageId =
|
||||
StatusPageUtil.getStatusPageId()!;
|
||||
return Promise.resolve(item);
|
||||
}}
|
||||
showAsColumns={1}
|
||||
|
Loading…
Reference in New Issue
Block a user