Skip to content

Commit 0d0e480

Browse files
fix(moderation): send notification typo (#1095)
1 parent b08525d commit 0d0e480

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

sources/moderations/api/src/:id/$procedures/validate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default new Hono<App_Context>().patch(
4141
var: { identite_pg_client, identite_pg, userinfo, sentry },
4242
}) {
4343
const { id } = req.valid("param");
44-
const { add_domain, add_member, send_notitfication, verification_type } =
44+
const { add_domain, add_member, send_notification, verification_type } =
4545
req.valid("form");
4646
const add_verified_domain = AddVerifiedDomain({
4747
get_organization_by_id: GetFicheOrganizationById({ pg: identite_pg }),
@@ -142,7 +142,7 @@ export default new Hono<App_Context>().patch(
142142
//#endregion
143143

144144
//#region ✨ Send notification
145-
if (send_notitfication) {
145+
if (send_notification) {
146146
await send_moderation_processed_email({ organization_id, user_id });
147147
}
148148
//#endregion

sources/moderations/lib/src/schema/validate.form.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { z } from "zod";
99
export const validate_form_schema = z.object({
1010
add_domain: z.string().default("false").pipe(z_coerce_boolean),
1111
add_member: z.enum(["AS_INTERNAL", "AS_EXTERNAL"]),
12-
send_notitfication: z.string().default("false").pipe(z_coerce_boolean),
12+
send_notification: z.string().default("false").pipe(z_coerce_boolean),
1313
verification_type: Verification_Type_Schema.or(
1414
z.literal("null").transform(() => null),
1515
).default("null"),

sources/moderations/ui/src/Actions/AcceptModal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import { AddAsMemberInternal } from "./AddAsMemberInternal";
77
import { AddDomain } from "./AddDomain";
88
import { SendNotification } from "./SendNotification";
99
import { TagInput } from "./TagInput";
10+
import { type Values } from "./context";
1011

1112
export async function AcceptModal({
1213
userEmail,
1314
moderation,
1415
}: {
1516
userEmail: string;
16-
moderation: any;
17+
moderation: Values["moderation"];
1718
}) {
1819
const hx_path_validate_moderation = await hx_urls.moderations[
1920
":id"
@@ -76,7 +77,7 @@ export async function AcceptModal({
7677
<SendNotification />
7778
</div>
7879
<div>
79-
<button class={`${button()} justify-center`} type="submit">
80+
<button class={button()} type="submit">
8081
Terminer
8182
</button>
8283
</div>

sources/moderations/ui/src/Actions/SendNotification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function SendNotification() {
2020
<div class="fr-checkbox-group">
2121
<input
2222
id={$send_notification}
23-
name={validate_form_schema.keyof().Enum.send_notitfication}
23+
name={validate_form_schema.keyof().Enum.send_notification}
2424
type="checkbox"
2525
value="true"
2626
checked={

0 commit comments

Comments
 (0)