feat: allow ad-hoc creation of new teams (#3964)
Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
@@ -263,6 +263,20 @@ export default class AuthStore {
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
createTeam = async (params: { name: string }) => {
|
||||
this.isSaving = true;
|
||||
|
||||
try {
|
||||
const res = await client.post(`/teams.create`, params);
|
||||
invariant(res?.success, "Unable to create team");
|
||||
|
||||
window.location.href = res.data.transferUrl;
|
||||
} finally {
|
||||
this.isSaving = false;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
logout = async (savePath = false) => {
|
||||
// if this logout was forced from an authenticated route then
|
||||
|
||||
Reference in New Issue
Block a user