Getting, creating, updating and deleting rune pages - dysolix/hasagi-core GitHub Wiki
Getting all rune pages
const runePages = await client.request("get", "/lol-perks/v1/pages");
Creating a new rune page
await client.request("post", "/lol-perks/v1/pages", {
body: {
name: "A new rune page",
primaryStyleId: 8300,
subStyleId: 8200,
selectedPerkIds: [8369, 8313, 8345, 8347, 8236, 8226, 5008, 5008, 5003],
current: true // Selects the rune page in the League client if true
} as any // Only these five properties are required, but because of the way the auto-generated types work, TypeScript doesn't know that :(
});
Deleting a rune page
await client.request("delete", "/lol-perks/v1/pages/{id}", {
path: {
id: "123"
}
})
Replacing a rune page
While there is an endpoint that replaces a specific rune page, I wouldn't recommend using it, because it doesn't show the changes in the League client. Instead delete the target rune page by it's id and create a new one.