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