Skip to content

Commit

Permalink
feat(locksmith, unlock-js, subgraph): Recipient value fix (#13493)
Browse files Browse the repository at this point in the history
* Quick recipient fix

* Update introspection.json
  • Loading branch information
SVell committed Mar 20, 2024
1 parent dfa3e48 commit d9f70ad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
3 changes: 1 addition & 2 deletions locksmith/src/utils/middlewares/lockManagerOrPayer.ts
Expand Up @@ -53,8 +53,7 @@ export const lockManagerOrPayerMiddleware: RequestHandler = async (
receipt?.payer?.toLocaleLowerCase() === userAddress?.toLocaleLowerCase()

const isRecipient =
// @ts-expect-error error TS2339: Property 'recipient' does not exist on type
receipt?.recipient?.toLowerCase() === userAddress?.toLowerCase()
receipt?.recipient?.toLocaleLowerCase() === userAddress?.toLocaleLowerCase()

if (!isLockManager && !isPayer && !isRecipient) {
return res.status(403).send({
Expand Down
2 changes: 1 addition & 1 deletion packages/unlock-js/src/subgraph/schema.graphql
Expand Up @@ -94,7 +94,7 @@ query AllReceipts(
timestamp
sender
payer
# recipient # removed until subgraph have been updated!
recipient
lockAddress
tokenAddress
gasTotal
Expand Down
36 changes: 17 additions & 19 deletions subgraph/introspection.json
Expand Up @@ -5933,6 +5933,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "recipient",
"description": "Fund receiver",
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "lockAddress",
"description": "Address of the Lock smart contract",
Expand Down Expand Up @@ -10960,11 +10972,7 @@
{
"name": "skip",
"description": null,
"locations": [
"FIELD",
"FRAGMENT_SPREAD",
"INLINE_FRAGMENT"
],
"locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"],
"args": [
{
"name": "if",
Expand All @@ -10985,11 +10993,7 @@
{
"name": "include",
"description": null,
"locations": [
"FIELD",
"FRAGMENT_SPREAD",
"INLINE_FRAGMENT"
],
"locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"],
"args": [
{
"name": "if",
Expand All @@ -11010,17 +11014,13 @@
{
"name": "entity",
"description": "Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive.",
"locations": [
"OBJECT"
],
"locations": ["OBJECT"],
"args": []
},
{
"name": "subgraphId",
"description": "Defined a Subgraph ID for an object type",
"locations": [
"OBJECT"
],
"locations": ["OBJECT"],
"args": [
{
"name": "id",
Expand All @@ -11041,9 +11041,7 @@
{
"name": "derivedFrom",
"description": "creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API.",
"locations": [
"FIELD_DEFINITION"
],
"locations": ["FIELD_DEFINITION"],
"args": [
{
"name": "field",
Expand Down

0 comments on commit d9f70ad

Please sign in to comment.