8000 fix(vercel): do not patch name or resourceConfig in Project (#206) · sam-goodwin/alchemy@7d2c8d5 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 7d2c8d5

Browse files
authored
fix(vercel): do not patch name or resourceConfig in Project (#206)
1 parent 7b00076 commit 7d2c8d5

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

alchemy/src/vercel/project.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,17 @@ export const Project = Resource(
398398
);
399399
}
400400

401-
// 409 Conflict: Can't update name, so remove it from the props
402-
// 400 Invalid Request: Should NOT have additional property `environmentVariables`
403-
const { environmentVariables, ...rest } = props;
404-
const response = await api.patch(`/projects/${this.output.id}`, rest);
401+
const { environmentVariables, ...updateProps }: any = { ...props };
402+
// 409 Conflict: Can't update these properties, so remove them from the updateProps
403+
delete updateProps.name;
404+
delete updateProps.environmentVariables;
405+
delete updateProps.gitRepository;
406+
delete updateProps.resourceConfig;
407+
408+
const response = await api.patch(
409+
`/projects/${this.output.id}`,
410+
updateProps,
411+
);
405412
const data = (await response.json()) as Project;
406413

407414
if (environmentVariables) {

alchemy/test/vercel/project-domain.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { BRANCH_PREFIX } from "../util.js";
99
import "../../src/test/bun.js";
1010
import { createVercelApi } from "../../src/vercel/api.js";
1111

12-
const test = alchemy.test(import.meta);
12+
const test = alchemy.test(import.meta, {
13+
prefix: BRANCH_PREFIX,
14+
});
15+
1316
const api = await createVercelApi({
1417
baseUrl: "https://api.vercel.com/v9",
1518
});

alchemy/test/vercel/project.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ const api = await createVercelApi({
1212
baseUrl: "https://api.vercel.com/v11",
1313
});
1414

15-
const test = alchemy.test(import.meta);
15+
const test = alchemy.test(import.meta, {
16+
prefix: BRANCH_PREFIX,
17+
});
1618

1719
describe("Project Resource", () => {
1820
// Use BRANCH_PREFIX for deterministic, non-colliding resource names
1921
const testId = `${BRANCH_PREFIX}-test-project`;
2022

2123
// TODO(sam): re-enable these after merging
22-
test.skipIf(true)("create, update, and delete project", async (scope) => {
24+
test("create, update, and delete project", async (scope) => {
2325
let project: Project | undefined;
2426
try {
2527
// Create a test project

0 commit comments

Comments
 (0)
0