feat: add guilds list in left sidebar

This commit is contained in:
Divlo
2021-11-18 22:47:46 +01:00
parent accd36d1fc
commit ad945d7a7a
33 changed files with 1511 additions and 1017 deletions

View File

@ -0,0 +1,15 @@
import { Handler } from '../handler'
import { guildExample, guildExample2 } from './guild'
export const getGuildsHandler: Handler = {
method: 'GET',
url: '/guilds',
response: {
statusCode: 200,
body: [
{ ...guildExample, defaultChannelId: 1 },
{ ...guildExample2, defaultChannelId: 2 }
]
}
}

View File

@ -1,4 +1,6 @@
export const guild = {
import { Guild } from '../../../models/Guild'
export const guildExample: Guild = {
id: 1,
name: 'GuildExample',
description: 'guild example.',
@ -7,7 +9,8 @@ export const guild = {
updatedAt: new Date().toISOString()
}
export const guild2 = {
...guild,
export const guildExample2: Guild = {
...guildExample,
id: 2,
name: 'app'
}

View File

@ -1,8 +1,8 @@
import { Handler } from '../handler'
import { guild } from './guild'
import { channel } from '../channels/channel'
import { memberComplete } from '../members/member'
import { guildExample } from './guild'
import { channelExample } from '../channels/channel'
import { memberExampleComplete } from '../members/member'
export const postGuildsHandler: Handler = {
method: 'POST',
@ -11,9 +11,9 @@ export const postGuildsHandler: Handler = {
statusCode: 201,
body: {
guild: {
...guild,
channels: [channel],
members: [memberComplete]
...guildExample,
channels: [channelExample],
members: [memberExampleComplete]
}
}
}

View File

@ -1,6 +1,6 @@
import { Handler } from '../../handler'
import { guild, guild2 } from '../guild'
import { guildExample, guildExample2 } from '../guild'
export const getGuildsPublicEmptyHandler: Handler = {
method: 'GET',
@ -17,8 +17,8 @@ export const getGuildsPublicHandler: Handler = {
response: {
statusCode: 200,
body: [
{ ...guild, membersCount: 1 },
{ ...guild2, membersCount: 1 }
{ ...guildExample, membersCount: 1 },
{ ...guildExample2, membersCount: 1 }
]
}
}
@ -28,6 +28,6 @@ export const getGuildsPublicSearchHandler: Handler = {
url: '/guilds/public',
response: {
statusCode: 200,
body: [{ ...guild2, membersCount: 1 }]
body: [{ ...guildExample2, membersCount: 1 }]
}
}