fix: not being able to get guild ID from route due to it being in a component

This commit is contained in:
SauceyRed 2025-07-13 00:42:07 +02:00
parent 1dfb964dd2
commit a2a28f9dbf
Signed by: sauceyred
GPG key ID: 270B096EF6E9A462

View file

@ -20,8 +20,6 @@ const props = defineProps<ModalProps & { guildId: string }>();
const invite = ref<string>();
const route = useRoute();
async function generateInvite(): Promise<void> {
const chars = "ABCDEFGHIJKLMNOQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"
let randCode = "";
@ -29,7 +27,7 @@ async function generateInvite(): Promise<void> {
randCode += chars[Math.floor(Math.random() * chars.length)];
}
const createdInvite: InviteResponse | undefined = await fetchWithApi(
`/guilds/${route.params.serverId}/invites`,
`/guilds/${props.guildId}/invites`,
{ method: "POST", body: { custom_id: randCode } }
);