Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Dec 11, 2024
1 parent 2f04ef2 commit 070914e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 42 deletions.
24 changes: 0 additions & 24 deletions novu/bridge/app/api/trigger/route.ts

This file was deleted.

7 changes: 5 additions & 2 deletions novu/bridge/app/novu/emails/CTAEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ export function createCTAEmailControlSchema({
}: CreateCTAEEmailControlSchemaProps) {
return createEmailControlSchema({
...rest,
introText: createOptionalOrNotString(defaultIntroText),
outroText: createOptionalOrNotString(defaultOutroText),
shape: {
...(rest.shape ?? {}),
introText: createOptionalOrNotString(defaultIntroText),
outroText: createOptionalOrNotString(defaultOutroText),
}
});
}

Expand Down
10 changes: 5 additions & 5 deletions novu/bridge/app/novu/emails/DefaultEmail.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Body, Container, Head, Html, Preview} from "@react-email/components";
import React, {CSSProperties, PropsWithChildren} from "react";
import {z} from "zod";
import {ZodRawShape} from "zod/lib/types";
import {z, ZodRawShape} from "zod";

type Props = PropsWithChildren<{}>;

Expand Down Expand Up @@ -67,14 +66,15 @@ export const styles: Record<string, CSSProperties> = {

export type CreateEmailControlSchemaProps = {
defaultEmailSubject: string;
} & ZodRawShape;
shape?: ZodRawShape;
};

export function createEmailControlSchema({
defaultEmailSubject,
...rest
shape,
}: CreateEmailControlSchemaProps) {
return z.object({
emailSubject: z.string().default(defaultEmailSubject),
...rest,
...(shape ?? {}),
});
}
2 changes: 1 addition & 1 deletion novu/bridge/app/novu/workflows/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./uploader/commit-acknowledged";
export * from "./uploader";
export * from "./expose";
1 change: 1 addition & 0 deletions novu/bridge/app/novu/workflows/uploader/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./commit-acknowledged";
10 changes: 0 additions & 10 deletions uploader/api/src/Consumer/Handler/AssetConsumerNotifyHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace App\Consumer\Handler;

use Alchemy\CoreBundle\Util\DoctrineUtil;
use Alchemy\NotifyBundle\Notification\NotifierInterface;
use App\Entity\Asset;
use App\Entity\Commit;
use Doctrine\ORM\EntityManagerInterface;
Expand All @@ -18,7 +17,6 @@
public function __construct(
private HttpClientInterface $client,
private EntityManagerInterface $em,
private NotifierInterface $notifier,
private string $uploaderUrl,
) {
}
Expand All @@ -30,14 +28,6 @@ public function __invoke(AssetConsumerNotify $message): void
$target = $commit->getTarget();
$accessToken = $target->getTargetAccessToken();

$this->notifier->notifyUser(
$commit->getUserId(),
'uploader-commit-acknowledged',
[
'assetCount' => $commit->getAssets()->count(),
]
);

if (empty($target->getTargetUrl()) || 'avoid' === $accessToken) {
return;
}
Expand Down

0 comments on commit 070914e

Please sign in to comment.