fix: not being able to get guild ID from route due to it being in a component
This commit is contained in:
parent
1dfb964dd2
commit
a2a28f9dbf
1 changed files with 1 additions and 3 deletions
|
@ -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 } }
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue