Skip to content

Commit b9728d5

Browse files
authored
Invite links fix (#278)
1 parent f7b7eee commit b9728d5

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

frontend/common/stores/organisation-store.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,28 @@ const controller = {
2727
store.loaded();
2828
}).catch(() => {
2929
});
30-
data.get(`${Project.api}organisations/${id}/invite-links/`).then((links) => {
31-
store.model.inviteLinks = links;
32-
if (!links || !links.length) {
33-
Promise.all([
34-
data.post(`${Project.api}organisations/${id}/invite-links/`, {
35-
role: 'ADMIN',
36-
}),
37-
data.post(`${Project.api}organisations/${id}/invite-links/`, {
38-
role: 'USER',
39-
}),
40-
]).then(() => {
41-
data.get(`${Project.api}organisations/${id}/invite-links/`).then((links) => {
42-
store.model.inviteLinks = links;
30+
}
31+
data.get(`${Project.api}organisations/${id}/invite-links/`).then((links) => {
32+
store.model.inviteLinks = links;
33+
if (!links || !links.length) {
34+
Promise.all([
35+
data.post(`${Project.api}organisations/${id}/invite-links/`, {
36+
role: 'ADMIN',
37+
}),
38+
data.post(`${Project.api}organisations/${id}/invite-links/`, {
39+
role: 'USER',
40+
}),
41+
]).then(() => {
42+
data.get(`${Project.api}organisations/${id}/invite-links/`).then((links) => {
43+
store.model.inviteLinks = links;
4344

44-
store.loaded();
45-
});
45+
store.loaded();
4646
});
47-
} else {
48-
store.loaded();
49-
}
50-
});
51-
}
47+
});
48+
} else {
49+
store.loaded();
50+
}
51+
});
5252

5353
return Promise.all(projects.map((project, i) => data.get(`${Project.api}environments/?project=${project.id}`)
5454
.then((res) => {

0 commit comments

Comments
 (0)