Merge pull request #3582 from fnwbr/master
Some checks are pending
Create docker images / Build, push, and deploy (push) Waiting to run
Create docker images / Build, push, and deploy-1 (push) Waiting to run
Node.js CI / build (mysql, 18.18, 10) (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run

`POST /api/websites/<id>`: Make name and domain optional in the validation schema
This commit is contained in:
Mike Cao 2025-09-23 17:53:40 -07:00 committed by GitHub
commit 9ee8f301ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View file

@ -149,6 +149,21 @@ describe('Website API tests', () => {
});
});
it('Updates a website with only shareId.', () => {
cy.request({
method: 'POST',
url: `/api/websites/${websiteId}`,
headers: {
'Content-Type': 'application/json',
Authorization: Cypress.env('authorization'),
},
body: { shareId: 'ABCDEF' },
}).then(response => {
expect(response.status).to.eq(200);
expect(response.body).to.have.property('shareId', 'ABCDEF');
});
});
it('Resets a website by removing all data related to the website.', () => {
cy.request({
method: 'POST',

View file

@ -31,8 +31,8 @@ export async function POST(
{ params }: { params: Promise<{ websiteId: string }> },
) {
const schema = z.object({
name: z.string(),
domain: z.string(),
name: z.string().optional(),
domain: z.string().optional(),
shareId: z.string().regex(SHARE_ID_REGEX).nullable().optional(),
});