Skip to content

Commit

Permalink
fix: updating owners does not work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
skinmaker1345 committed Oct 19, 2024
1 parent cfd9400 commit c9cb46e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,11 @@ async function updateWebhook(id: string, type: 'bots' | 'servers', value: Partia
}

async function updateOwners(id: string, owners: string[], type: 'bot' | 'server'): Promise<void> {
await knex('owners_mapping').where({ target: id }).del()
await knex('owners_mapping').where({ target_id: id }).del()
await knex('owners_mapping').insert(
owners.map((el) => ({
owner: el,
target: id,
user_id: el,
target_id: id,
type: type === 'bot' ? ObjectType.Bot : ObjectType.Server,
}))
)
Expand Down

0 comments on commit c9cb46e

Please sign in to comment.