From f579a81ffa41987408a356d6fc908e2b795cfbbd Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Tue, 16 May 2023 16:18:13 +0100 Subject: [PATCH] refactor: `Session.edit` => `Session.rename` --- src/classes/Session.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/classes/Session.ts b/src/classes/Session.ts index 224527ce..a8a464d4 100644 --- a/src/classes/Session.ts +++ b/src/classes/Session.ts @@ -50,11 +50,15 @@ export class Session { } /** - * Edit a session - * @param data Changes + * Rename a session + * @param name New name */ - async edit(data: DataEditSession) { - await this.#collection.client.api.patch(`/auth/session/${this.id}`, data); + async rename(name: string) { + await this.#collection.client.api.patch(`/auth/session/${this.id}`, { + friendly_name: name, + }); + + this.#collection.updateUnderlyingObject(this.id, "name", name); } /**