8000 Allow passing subdomain as `null` by apoorv-mishra · Pull Request #5289 · outline/outline · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow passing subdomain as null #5289

New issue 8000

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

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/routes/api/teams/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
11 changes: 11 additions & 0 deletions server/routes/api/teams/teams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
0