Skip to content

bugfix cas-168 update does not overwrite nil fields#93

Merged
0xmovses merged 4 commits intomainfrom
rich/cas-168
Jul 4, 2022
Merged

bugfix cas-168 update does not overwrite nil fields#93
0xmovses merged 4 commits intomainfrom
rich/cas-168

Conversation

@0xmovses
Copy link
Copy Markdown
Contributor

@0xmovses 0xmovses commented Jul 1, 2022

the avatar, or Logo field was being overwritten with nil on update if a value was not sent in the payload. This has been fixed by using the COALESCE keyword in the sql UpdateCommunity models function

@0xmovses 0xmovses requested review from dbslone and germanurrus July 1, 2022 15:15
Copy link
Copy Markdown
Contributor

@germanurrus germanurrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason now name is not updating:
Sending this:

{
    "name": "Update Name",
    "signingAddr": "0xf8d6e0586b0a20c7",
    "timestamp": "1656696627669",
    "compositeSignatures": [
        {
            "addr": "0xf8d6e0586b0a20c7",
            "keyId": 0,
            "signature": "f53e3ac4cf37954c4c055824d748b4cdb354ba2cc18835d2d7d9d1159a423706d24d8889e8344b48c708e3e9916131962b5f64f7f61dfd35d4661c6fbbdc61f6"
        }
    ]
}

and response is:

{
"id":2,
   "name":"sds",
   "logo":"https://gateway.pinata.cloud/ipfs/QmdjLkYuDhxeJirgTiyAjJk2kw8nvjJyM8tWi7c3hAPmio",
   "onlyAuthorsToSubmit":false,
   "slug":"a42891b85e",
   "contractName":"11",
   "timestamp":"",
   "compositeSignatures":null,
   "creatorAddr":"0xf8d6e0586b0a20c7",
   "createdAt":"2022-07-01T17:13:25.645701Z",
   "cid":"QmWy3NUoteCoB1stj8fMHUSQAkLyBfEikrqWGVB2yZfsND"
}

@germanurrus germanurrus self-requested a review July 1, 2022 17:28
@dbslone dbslone self-requested a review July 1, 2022 17:44
@0xmovses
Copy link
Copy Markdown
Contributor Author

0xmovses commented Jul 1, 2022

checking this now

@0xmovses
Copy link
Copy Markdown
Contributor Author

0xmovses commented Jul 1, 2022

fixed. can you test again @germanurrus ?

@germanurrus
Copy link
Copy Markdown
Contributor

fixed. can you test again @germanurrus ?

Tested again and works.

@0xmovses 0xmovses merged commit c37d0ef into main Jul 4, 2022
@0xmovses 0xmovses deleted the rich/cas-168 branch July 4, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants