Skip to content

Commit

Permalink
fix: Item update (#728)
Browse files Browse the repository at this point in the history
* fix: Item update

* fix: Remove unecessary logic
  • Loading branch information
LautaroPetaccio committed Jan 17, 2024
1 parent df61133 commit 58e4c6a
Show file tree
Hide file tree
Showing 5 changed files with 503 additions and 469 deletions.
11 changes: 7 additions & 4 deletions src/Collection/Collection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,14 @@ export class CollectionService {
public async isDCLManager(id: string, ethAddress: string): Promise<boolean> {
const collection = await this.getCollection(id)

if (collection) {
return collection.managers.some((manager) => manager === ethAddress)
}
return collection && this.isDCLManagerOfCollection(collection, ethAddress)
}

return false
public isDCLManagerOfCollection(
collection: CollectionAttributes,
ethAddress: string
): boolean {
return collection.managers.some((manager) => manager === ethAddress)
}

public async isOwnedOrManagedBy(
Expand Down
2 changes: 1 addition & 1 deletion src/Item/Item.errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class UnauthorizedToChangeToCollectionError extends Error {
public eth_address: string,
public collection_id: string
) {
super("The new collection for the item isn't owned by the same owner.")
super("You're not authorized to to change this collection.")
}
}

Expand Down
Loading

0 comments on commit 58e4c6a

Please sign in to comment.