mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
dashboard/api: add support for Zeppelin staff members; add ViewGuild permission; code cleanup
This commit is contained in:
parent
7e60950900
commit
d03d729438
13 changed files with 175 additions and 75 deletions
|
@ -41,7 +41,17 @@
|
|||
AceEditor,
|
||||
},
|
||||
async mounted() {
|
||||
await this.$store.dispatch("guilds/loadAvailableGuilds");
|
||||
try {
|
||||
await this.$store.dispatch("guilds/loadGuild", this.$route.params.guildId);
|
||||
} catch (err) {
|
||||
if (err instanceof ApiError) {
|
||||
this.$router.push('/dashboard');
|
||||
return;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
||||
if (this.guild == null) {
|
||||
this.$router.push('/dashboard');
|
||||
return;
|
||||
|
@ -66,7 +76,7 @@
|
|||
computed: {
|
||||
...mapState('guilds', {
|
||||
guild() {
|
||||
return this.$store.state.guilds.available.find(g => g.id === this.$route.params.guildId);
|
||||
return this.$store.state.guilds.available.get(this.$route.params.guildId);
|
||||
},
|
||||
config() {
|
||||
return this.$store.state.guilds.configs[this.$route.params.guildId];
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
computed: {
|
||||
...mapState('guilds', {
|
||||
guilds: state => {
|
||||
const guilds = Array.from(state.available || []);
|
||||
const guilds = Array.from(state.available.values());
|
||||
guilds.sort((a, b) => {
|
||||
if (a.name > b.name) return 1;
|
||||
if (a.name < b.name) return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue