Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Init cay #138

Merged
merged 2 commits into from
Oct 15, 2024
Merged

fix: Init cay #138

merged 2 commits into from
Oct 15, 2024

Conversation

adityachoudhari26
Copy link
Contributor

No description provided.

Comment on lines 43 to 49
.onConflictDoUpdate({
target: [schema.system.workspaceId, schema.system.slug],
set: {
name: sql`excluded.name`,
description: sql`excluded.description`,
},
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use the util builder I made?

)
.then((rows) => rows.map(({ id }) => id));

const systemMap = new Map(systems.map((system) => [system.slug, system]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const systemMap = new Map(systems.map((system) => [system.slug, system]));
const systemMap = Object.fromEntires(systems.map((system) => [system.slug, system]));

Is there a specific reason for maps?

});
};

export const POST = async (req: NextRequest) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are posts ment for upserts or patchs?

@@ -2,12 +2,13 @@ import { z } from "zod";

export const release = z.object({
name: z.string(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is also optional

@adityachoudhari26 adityachoudhari26 merged commit 391a262 into main Oct 15, 2024
13 checks passed
@adityachoudhari26 adityachoudhari26 deleted the init-cay branch October 15, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants