diff --git a/components/InvitePopup.vue b/components/InvitePopup.vue index ee6f124..262507a 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( - `/servers/${route.params.serverId}/invites`, + `/guilds/${route.params.serverId}/invites`, { method: "POST", body: { custom_id: "oijewfoiewf" } } ); diff --git a/components/Message.vue b/components/Message.vue index bf85a17..32162c1 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" | "compact", + type: "normal" | "grouped", marginBottom: boolean }>(); diff --git a/components/MessageArea.vue b/components/MessageArea.vue index 7d3520c..1688f6d 100644 --- a/components/MessageArea.vue +++ b/components/MessageArea.vue @@ -27,12 +27,13 @@ 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)); @@ -77,7 +78,7 @@ if (messagesRes) { continue; } console.log("RETURNING " + lessThanMax.toString().toUpperCase()); - messagesType.value[message.uuid] = "compact"; + messagesType.value[message.uuid] = "grouped"; } } diff --git a/layouts/client.vue b/layouts/client.vue index 1038412..312b0a5 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 servers: GuildResponse[] | undefined = await fetchWithApi("/me/guilds"); +const guilds: 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 cdb2c94..ac36105 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="`/servers/${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,18 +102,19 @@ const members = [ onMounted(async () => { console.log("channelid: set loading to true"); - server.value = await fetchWithApi(`servers/${route.params.serverId}`); + const guildUrl = `guilds/${route.params.serverId}`; + server.value = await fetchWithApi(guildUrl); - channels.value = await fetchWithApi(`/channels`); + channels.value = await fetchWithApi(`${guildUrl}/channels`); console.log("channels:", channels.value); - channel.value = await fetchWithApi(route.path); + channel.value = await fetchWithApi(`/channels/${route.params.channelId}`); console.log("channel:", channel.value); console.log("channelid: channel:", channel); console.log("channelid: set loading to false"); }); -function showServerSettings() { } +function showGuildSettings() { } function toggleInvitePopup(e: Event) { e.preventDefault(); diff --git a/pages/servers/[serverId]/index.vue b/pages/servers/[serverId]/index.vue index ce6bea5..28ee913 100644 --- a/pages/servers/[serverId]/index.vue +++ b/pages/servers/[serverId]/index.vue @@ -5,8 +5,8 @@