fix: allow null for subdomain (#5289)
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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", {
|
||||
|
||||
Reference in New Issue
Block a user