fix: allow null for subdomain (#5289)

This commit is contained in:
Apoorv Mishra
2023-05-02 18:19:08 +05:30
committed by GitHub
parent cda8acddbb
commit 3d6a875631
2 changed files with 12 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ export const TeamsUpdateSchema = BaseSchema.extend({
/** Avatar URL */
avatarUrl: z.string().optional(),
/** The subdomain to access the team */
subdomain: z.string().optional(),
subdomain: z.string().nullish(),
/** Whether public sharing is enabled */
sharing: z.boolean().optional(),
/** Whether siginin with email is enabled */

View File

@@ -50,6 +50,17 @@ describe("#team.update", () => {
expect(body.data.name).toEqual("New name");
});
it("should not invalidate request if subdomain is sent as null", async () => {
const admin = await buildAdmin();
const res = await server.post("/api/team.update", {
body: {
token: admin.getJwtToken(),
subdomain: null,
},
});
expect(res.status).not.toBe(400);
});
it("should add new allowed Domains, removing empty string values", async () => {
const { admin, team } = await seed();
const res = await server.post("/api/team.update", {