From 6d3998368f523001533aa61d312ae4d3da1bd6e6 Mon Sep 17 00:00:00 2001 From: webdev03 <75148774+webdev03@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:31:53 +1300 Subject: [PATCH] JSDocify --- src/classes/Project.ts | 3 +++ src/classes/forums/Post.ts | 3 +++ src/classes/forums/Topic.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/classes/Project.ts b/src/classes/Project.ts index 55eb815..2fb9a12 100644 --- a/src/classes/Project.ts +++ b/src/classes/Project.ts @@ -207,6 +207,9 @@ class Project { return Number((await request.json())["id"]); } + /** + * Set if comments should be allowed or not + */ async setCommentsAllowed(state: boolean) { if (!this.session?.auth) throw Error("You need to be logged in"); const request = await fetch( diff --git a/src/classes/forums/Post.ts b/src/classes/forums/Post.ts index e7e326b..93e4f4c 100644 --- a/src/classes/forums/Post.ts +++ b/src/classes/forums/Post.ts @@ -26,6 +26,9 @@ class Post { if (data) this.data = data; } + /** + * Gets data from the Scratch website and sets the Post.data + */ async setData() { const request = await fetch( `https://scratch.mit.edu/discuss/m/post/${this.id}` diff --git a/src/classes/forums/Topic.ts b/src/classes/forums/Topic.ts index fe2ffb0..8da5373 100644 --- a/src/classes/forums/Topic.ts +++ b/src/classes/forums/Topic.ts @@ -28,6 +28,9 @@ class Topic { if (data) this.data = data; } + /** + * Gets data from the Scratch website and sets the Topic.data + */ async setData() { const request = await fetch( `https://scratch.mit.edu/discuss/m/topic/${this.id}`