mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Embed endpoint into function instead of assigning to var
This commit is contained in:
+13
-8
@@ -625,8 +625,9 @@ export function getGuild(guildID: string, counts = true) {
|
|||||||
|
|
||||||
/** Returns the guild template if it exists */
|
/** Returns the guild template if it exists */
|
||||||
export function getGuildTemplate(guildID: string, templateCode: string) {
|
export function getGuildTemplate(guildID: string, templateCode: string) {
|
||||||
const endpoint = `${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`;
|
return RequestManager.get(
|
||||||
return RequestManager.get(endpoint);
|
`${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -654,8 +655,9 @@ export function getGuildTemplates(guildID: string) {
|
|||||||
|
|
||||||
/** Deletes a template from a guild */
|
/** Deletes a template from a guild */
|
||||||
export function deleteGuildTemplate(guildID: string, templateCode: string) {
|
export function deleteGuildTemplate(guildID: string, templateCode: string) {
|
||||||
const endpoint = `${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`;
|
return RequestManager.delete(
|
||||||
return RequestManager.delete(endpoint);
|
`${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -680,8 +682,9 @@ export interface CreateGuildTemplate {
|
|||||||
|
|
||||||
/** Syncs the template to the guild's current state */
|
/** Syncs the template to the guild's current state */
|
||||||
export function syncGuildTemplate(guildID: string, templateCode: string) {
|
export function syncGuildTemplate(guildID: string, templateCode: string) {
|
||||||
const endpoint = `${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`;
|
return RequestManager.put(
|
||||||
return RequestManager.put(endpoint);
|
`${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Edit a template's metadata */
|
/** Edit a template's metadata */
|
||||||
@@ -690,8 +693,10 @@ export function editGuildTemplate(
|
|||||||
templateCode: string,
|
templateCode: string,
|
||||||
data: EditGuildTemplate,
|
data: EditGuildTemplate,
|
||||||
) {
|
) {
|
||||||
const endpoint = `${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`;
|
return RequestManager.patch(
|
||||||
return RequestManager.patch(endpoint, data);
|
`${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EditGuildTemplate {
|
export interface EditGuildTemplate {
|
||||||
|
|||||||
Reference in New Issue
Block a user