Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions classes/Group/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export default class Group {
if (!this.isValidRolesMap(roles))
throw new Error("Invalid roles. Must be a JSON Object with keys as roles and values as arrays of permissions or space-delimited strings.")
this.data.customRoles = roles
await this.update()
return this.update()
}

async addCustomRoles(roleMap) {
Expand All @@ -277,7 +277,7 @@ export default class Group {
if (!this.isValidRolesMap(roleMap))
throw new Error("Invalid roles. Must be a JSON Object with keys as roles and values as arrays of permissions or space-delimited strings.")
this.data.customRoles = { ...this.data.customRoles, ...roleMap }
await this.update()
return this.update()
}

async removeCustomRoles(roleName) {
Expand All @@ -286,7 +286,7 @@ export default class Group {
}

delete this.data.customRoles[roleName]
await this.update()
return this.update()
}

async save() {
Expand Down Expand Up @@ -324,8 +324,8 @@ export default class Group {
await this.addMemberRoles(this.data.creator, "OWNER", true, false)
}
if (!this.getByRole("LEADER")?.length) {
await this.addMemberRoles(this.data.creator, "LEADER", false, false)
}
await this.addMemberRoles(this.data.creator, "LEADER", false, false)
}
}

static async createNewGroup(creator, payload) {
Expand Down
10 changes: 5 additions & 5 deletions database/tiny/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class DatabaseController {
method: 'post',
body: JSON.stringify(query),
headers: {
'Content-Type': 'application/json; charset=utf-8'
'Content-Type': 'application/ld+json; charset=utf-8'
}
})
.then(resp => {
Expand Down Expand Up @@ -129,7 +129,7 @@ class DatabaseController {
method: 'post',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json; charset=utf-8'
'Content-Type': 'application/ld+json; charset=utf-8'
}
})
.then(resp => {
Expand Down Expand Up @@ -160,7 +160,7 @@ class DatabaseController {
method: 'put',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json; charset=utf-8'
'Content-Type': 'application/ld+json; charset=utf-8'
}
})
.then(resp => {
Expand Down Expand Up @@ -190,7 +190,7 @@ class DatabaseController {
err_out._dbaction = this.URLS.OVERWRITE

const headers = {
'Content-Type': 'application/json; charset=utf-8'
'Content-Type': 'application/ld+json; charset=utf-8'
}

// Add optimistic locking header if __rerum.isOverwritten exists
Expand Down Expand Up @@ -255,7 +255,7 @@ class DatabaseController {
method: 'delete',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json; charset=utf-8'
'Content-Type': 'application/ld+json; charset=utf-8'
}
})
.then(resp => {
Expand Down
58 changes: 32 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading