Open JamesxX opened 2 years ago
In the example code below:
mySubreddit.getWikiPage(args).fetch().then( wiki: Snoowrap.WikiPage ) =>{ /// Do Stuff wiki.edit({ text: edittedWikiPage, reason: 'reason', }); })
produces the below error:
url: "r/".concat(_this4.subreddit.display_name, "/api/wiki/edit"), ^ TypeError: Cannot read properties of undefined (reading 'display_name')
Internally, _this4.subreddit appears to be undefined, with no opportunity to remedy.
_this4.subreddit
@JamesxX Fixed by adding:
_transformApiResponse (res: WikiPage) { res.title = this.title res.subreddit = this.subreddit return res }
...to the WikiPage class.
In the example code below:
produces the below error:
Internally,
_this4.subreddit
appears to be undefined, with no opportunity to remedy.