Skip to content

Commit

Permalink
feat: revert change on routers
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosantangelo committed Nov 19, 2021
1 parent 26aa636 commit c226ee9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/Collection/Collection.router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { validate as validateUuid } from 'uuid'
import { server } from 'decentraland-server'
import { Router } from '../common/Router'
import { HTTPError, STATUS_CODES } from '../common/HTTPError'
Expand Down Expand Up @@ -38,15 +37,12 @@ const validator = getValidator()
export class CollectionRouter extends Router {
public service = new CollectionService()

private modelAuthorizationCheck = async (
private modelAuthorizationCheck = (
_: OwnableModel,
id: string,
ethAddress: string
): Promise<boolean> => {
return (
validateUuid(id) &&
(await this.service.isOwnedOrManagedBy(id, ethAddress))
)
return this.service.isOwnedOrManagedBy(id, ethAddress)
}

mount() {
Expand Down
8 changes: 2 additions & 6 deletions src/Item/Item.router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { validate as validateUuid } from 'uuid'
import { Request, Response } from 'express'
import { utils } from 'decentraland-commons'
import { server } from 'decentraland-server'
Expand Down Expand Up @@ -49,15 +48,12 @@ export class ItemRouter extends Router {
| ((req: Request, res: Response) => Promise<boolean>) // Promisified RequestHandler
| undefined

private modelAuthorizationCheck = async (
private modelAuthorizationCheck = (
_: OwnableModel,
id: string,
ethAddress: string
): Promise<boolean> => {
return (
validateUuid(id) &&
(await this.itemService.isOwnedOrManagedBy(id, ethAddress))
)
return this.itemService.isOwnedOrManagedBy(id, ethAddress)
}

mount() {
Expand Down

0 comments on commit c226ee9

Please sign in to comment.