Skip to content

Commit

Permalink
fix(creative): for news creatives, we still need dimensions (#1374)
Browse files Browse the repository at this point in the history
By removing pieces of initial creative, I also removed dimensions. Use
existing function to get correct payload & dimensions
  • Loading branch information
IanKrieger authored Oct 11, 2024
1 parent 5d0df34 commit 2269c04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/components/Creatives/CreateCreativeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export function CreateCreativeButton({ index }: Props) {
],
});

const creative = validCreativeFields(
{ ...newMeta.value, id: "" },
advertiser.id,
);

return (
<LoadingButton
variant="contained"
Expand All @@ -59,8 +64,11 @@ export function CreateCreativeButton({ index }: Props) {
create({
variables: {
input: {
..._.omit(newMeta.value, ["included", "type"]),
advertiserId: advertiser.id,
name: creative.name,
state: "under_review",
payloadNotification: creative.payloadNotification,
payloadInlineContent: creative.payloadInlineContent,
},
},
});
Expand Down
4 changes: 3 additions & 1 deletion src/validation/CreativeSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export const CreativeSchema = () =>
.max(15, t`Call to action must be less than 15 characters`)
.required(t`Call to action is required`),
description: string().required(t`Ad description is required`),
dimensions: string().required(t`Ad image dimensions are required`),
dimensions: string()
.required(t`Ad image dimensions are required`)
.default("900x750"),
imageUrl: string()
.url(t`Image URL must be valid`)
.required()
Expand Down

0 comments on commit 2269c04

Please sign in to comment.