diff --git a/components/InvitePopup.vue b/components/InvitePopup.vue index 262507a..ee6f124 100644 --- a/components/InvitePopup.vue +++ b/components/InvitePopup.vue @@ -20,7 +20,7 @@ const route = useRoute(); async function generateInvite(): Promise { const createdInvite: InviteResponse | undefined = await fetchWithApi( - `/guilds/${route.params.serverId}/invites`, + `/servers/${route.params.serverId}/invites`, { method: "POST", body: { custom_id: "oijewfoiewf" } } ); diff --git a/components/Message.vue b/components/Message.vue index 32162c1..bf85a17 100644 --- a/components/Message.vue +++ b/components/Message.vue @@ -18,7 +18,7 @@ -
+
@@ -42,7 +42,7 @@ const props = defineProps<{ text: string, timestamp: number, format: "12" | "24", - type: "normal" | "grouped", + type: "normal" | "compact", marginBottom: boolean }>(); diff --git a/components/MessageArea.vue b/components/MessageArea.vue index 1688f6d..7d3520c 100644 --- a/components/MessageArea.vue +++ b/components/MessageArea.vue @@ -27,13 +27,12 @@ import scrollToBottom from '~/utils/scrollToBottom'; const props = defineProps<{ channelUrl: string, amount?: number, offset?: number }>(); const messageTimestamps = ref>({}); -const messagesType = ref>({}); +const messagesType = ref>({}); const messagesRes: MessageResponse[] | undefined = await fetchWithApi( `${props.channelUrl}/messages`, { query: { "amount": props.amount ?? 100, "offset": props.offset ?? 0 } } ); - if (messagesRes) { messagesRes.reverse(); console.log("messages res:", messagesRes.map(msg => msg.message)); @@ -78,7 +77,7 @@ if (messagesRes) { continue; } console.log("RETURNING " + lessThanMax.toString().toUpperCase()); - messagesType.value[message.uuid] = "grouped"; + messagesType.value[message.uuid] = "compact"; } } diff --git a/layouts/client.vue b/layouts/client.vue index 312b0a5..1038412 100644 --- a/layouts/client.vue +++ b/layouts/client.vue @@ -11,7 +11,7 @@
- +
@@ -26,7 +26,7 @@ import type { GuildResponse } from '~/types/interfaces'; const loading = useState("loading", () => false); -const guilds: GuildResponse[] | undefined = await fetchWithApi("/me/guilds"); +const servers: GuildResponse[] | undefined = await fetchWithApi("/me/guilds"); //const servers = await fetchWithApi("/servers") as { uuid: string, name: string, description: string }[]; //console.log("servers:", servers); diff --git a/pages/servers/[serverId]/channels/[channelId].vue b/pages/servers/[serverId]/channels/[channelId].vue index ac36105..cdb2c94 100644 --- a/pages/servers/[serverId]/channels/[channelId].vue +++ b/pages/servers/[serverId]/channels/[channelId].vue @@ -5,7 +5,7 @@

{{ server?.name }} - @@ -20,7 +20,7 @@
+ :href="`/guilds/${route.params.serverId}/channels/${channel.uuid}`" />

@@ -40,7 +40,7 @@ const route = useRoute(); const loading = useState("loading"); -const channelUrlPath = `channels/${route.params.channelId}`; +const channelUrlPath = `/channels/${route.params.channelId}`; const server = ref(); const channels = ref(); @@ -102,19 +102,18 @@ const members = [ onMounted(async () => { console.log("channelid: set loading to true"); - const guildUrl = `guilds/${route.params.serverId}`; - server.value = await fetchWithApi(guildUrl); + server.value = await fetchWithApi(`servers/${route.params.serverId}`); - channels.value = await fetchWithApi(`${guildUrl}/channels`); + channels.value = await fetchWithApi(`/channels`); console.log("channels:", channels.value); - channel.value = await fetchWithApi(`/channels/${route.params.channelId}`); + channel.value = await fetchWithApi(route.path); console.log("channel:", channel.value); console.log("channelid: channel:", channel); console.log("channelid: set loading to false"); }); -function showGuildSettings() { } +function showServerSettings() { } function toggleInvitePopup(e: Event) { e.preventDefault(); diff --git a/pages/servers/[serverId]/index.vue b/pages/servers/[serverId]/index.vue index 28ee913..ce6bea5 100644 --- a/pages/servers/[serverId]/index.vue +++ b/pages/servers/[serverId]/index.vue @@ -5,8 +5,8 @@