fix creaste

main
jerl 2023-05-29 18:58:03 -07:00
parent 767c040634
commit 1e445c25dc
1 changed files with 5 additions and 5 deletions

View File

@ -24,31 +24,31 @@ const create_thread = async (msg, respond, socket, io) => {
// set up permissions
if (!msg.permissions || !msg.permissions.view_limited) {
await db.query(
`insert into permissions (thread, type, flexible, permission, value)
`insert into permissions (thread, type, mutable, permission, value)
values (?, ?, ?, ?, ?)`,
[thread_id, "everyone", false, "view", "true"]
);
if (!msg.permissions || !msg.permissions.post_limited) {
await db.query(
`insert into permissions (thread, type, flexible, permission, value)
`insert into permissions (thread, type, mutable, permission, value)
values (?, ?, ?, ?, ?)`,
[thread_id, "everyone", false, "post", "true"]
);
} else {
await db.query(
`insert into permissions (thread, type, flexible, permission, value)
`insert into permissions (thread, type, mutable, permission, value)
values (?, ?, ?, ?, ?)`,
[thread_id, "members", false, "post", "true"]
);
}
} else {
await db.query(
`insert into permissions (thread, type, flexible, permission, value)
`insert into permissions (thread, type, mutable, permission, value)
values (?, ?, ?, ?, ?)`,
[thread_id, "members", false, "view", "true"]
);
await db.query(
`insert into permissions (thread, type, flexible, permission, value)
`insert into permissions (thread, type, mutable, permission, value)
values (?, ?, ?, ?, ?)`,
[thread_id, "members", false, "post", "true"]
);