Skip to content

Commit

Permalink
Create test_signed.tsx (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil authored Jun 21, 2024
1 parent 2ab7ea6 commit f4991a9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/~/moderations/api/src/:id/Member_Invalid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Desicison_Context } from "./Desicison_Context";
import { ModerationPage_Context } from "./context";
import * as accountant from "./responses/accountant";
import * as already_signed from "./responses/already_signed";
import * as test_signed from "./responses/test_signed";
import * as chorus_pro from "./responses/chorus_pro";
import * as contractors from "./responses/contractors";
import * as first_last_name from "./responses/first_last_name";
Expand All @@ -24,6 +25,7 @@ import * as use_pro_email from "./responses/use_pro_email";
//

const reponse_templates = [
test_signed,
first_last_name,
link_with_organization,
use_pro_email,
Expand Down
39 changes: 39 additions & 0 deletions packages/~/moderations/api/src/:id/responses/test_signed.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//

import type { MonComptePro_Pg_Context } from "@~/app.middleware/moncomptepro_pg";
import { get_emails_by_organization_id } from "@~/users.repository/get_emails_by_organization_id";
import { useContext } from "hono/jsx";
import { useRequestContext } from "hono/jsx-renderer";
import { dedent } from "ts-dedent";
import { ModerationPage_Context } from "../context";

export const label = "Vous possédez déjà un compte MonComptePro";

export default async function template() {
const { moderation } = useContext(ModerationPage_Context);

const {
var: { moncomptepro_pg },
} = useRequestContext<MonComptePro_Pg_Context>();

const members_email = await get_emails_by_organization_id(moncomptepro_pg, {
organization_id: moderation.organization.id,
});

return dedent`
Bonsoir,
Votre demande pour rejoindre l'organisation « ${moderation.organization.cached_libelle} » a été prise en compte sur https://app.moncomptepro.beta.gouv.fr.
Vous possédez déjà un compte MonComptePro :
- ${members_email.map(({ email }) => email).join("\n- ")}
Merci de bien vouloir vous connecter avec le compte déjà existant.
Je reste à votre disposition pour tout complément d'information.
Excellente journée,
L’équipe MonComptePro.
`;
}

0 comments on commit f4991a9

Please sign in to comment.