Skip to content

Commit

Permalink
Fixed owner to take from middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
divyank-aggarwal committed Oct 6, 2022
1 parent 3ad16ca commit 2e09af3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/controllers/api/personal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,8 @@ export async function deletePersonProfile(req, res) {

export async function deleteTicketByAdmin(req, res) {
if (!req.owner) return failure(res, 'no owner')
const tenant: number = req.owner.id

try {
const owner: Contact = (await models.Contact.findOne({
where: { tenant, isOwner: true },
})) as Contact
const {
host,
pubkey,
Expand All @@ -103,7 +99,7 @@ export async function deleteTicketByAdmin(req, res) {
host || config.tribes_host,
pubkey,
created,
owner.publicKey
req.owner.publicKey
)

success(res, person)
Expand Down

0 comments on commit 2e09af3

Please sign in to comment.