Allow wall mods to file hiatuses
This commit is contained in:
parent
0334dc1678
commit
15351b3c12
@ -89,7 +89,9 @@ export default function (
|
||||
{typeof props.hiatus === "boolean" ? (
|
||||
<Box>
|
||||
<Heading size="xs">Notice Type</Heading>
|
||||
<Text>{props.hiatus ? "Hiatus" : "Inactivity"}</Text>
|
||||
<Text>
|
||||
{props.hiatus ? "Hiatus/Inactivity" : "Activity Decrease"}
|
||||
</Text>
|
||||
</Box>
|
||||
) : null}
|
||||
{props.decisions ? (
|
||||
|
@ -69,7 +69,9 @@ export default function (props: {
|
||||
body: JSON.stringify({
|
||||
departments,
|
||||
end,
|
||||
hiatus: departments.includes("DM") ? isHiatus : undefined,
|
||||
hiatus: ["DM", "WM"].find((d) => departments.includes(d))
|
||||
? isHiatus
|
||||
: undefined,
|
||||
reason,
|
||||
start,
|
||||
}),
|
||||
@ -147,7 +149,7 @@ export default function (props: {
|
||||
))}
|
||||
</VStack>
|
||||
</CheckboxGroup>
|
||||
{departments.includes("DM") ? (
|
||||
{["DM", "WM"].find((d) => departments.includes(d)) ? (
|
||||
<>
|
||||
<br />
|
||||
<br />
|
||||
@ -156,8 +158,8 @@ export default function (props: {
|
||||
value={JSON.stringify(isHiatus)}
|
||||
>
|
||||
<HStack>
|
||||
<Radio value="false">Inactivity</Radio>
|
||||
<Radio value="true">Hiatus</Radio>
|
||||
<Radio value="false">Activity Decrease</Radio>
|
||||
<Radio value="true">Inactivity/Hiatus</Radio>
|
||||
</HStack>
|
||||
</RadioGroup>
|
||||
</>
|
||||
|
@ -32,8 +32,8 @@ export default function (
|
||||
if (typeof hiatus !== "undefined" && typeof hiatus !== "boolean")
|
||||
return jsonError("Invalid notice", 400);
|
||||
|
||||
if (!selectedDepartments.includes("DM") && hiatus)
|
||||
return jsonError("Only discord mods can file hiatuses", 400);
|
||||
if (!["DM", "WM"].find((d) => selectedDepartments.includes(d)) && hiatus)
|
||||
return jsonError("Only discord and wall mods can file hiatuses", 400);
|
||||
|
||||
if (
|
||||
isNaN(endDate.getFullYear()) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user