Update:Rename UserCollections to Collections

This commit is contained in:
advplyr 2022-11-11 17:13:10 -06:00
parent fdf67e17a0
commit 4cbc8676c6
11 changed files with 30 additions and 37 deletions

View file

@ -1,11 +1,11 @@
const Logger = require('../Logger')
const UserCollection = require('../objects/UserCollection')
const Collection = require('../objects/Collection')
class CollectionController {
constructor() { }
async create(req, res) {
var newCollection = new UserCollection()
var newCollection = new Collection()
req.body.userId = req.user.id
var success = newCollection.setData(req.body)
if (!success) {

View file

@ -105,13 +105,6 @@ class UserController {
}
var user = req.reqUser
// delete user collections
var userCollections = this.db.collections.filter(c => c.userId === user.id)
var collectionsToRemove = userCollections.map(uc => uc.id)
for (let i = 0; i < collectionsToRemove.length; i++) {
await this.db.removeEntity('collection', collectionsToRemove[i])
}
// Todo: check if user is logged in and cancel streams
var userJson = user.toJSONForBrowser()