-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement AddressBookItem update #2149
base: main
Are you sure you want to change the base?
Conversation
authPayload: args.authPayload, | ||
address: args.address, | ||
}); | ||
const addressBook = await this.datasource.getAddressBook({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Does it happen that the account
is not found? If so, we shouldn't try to fetch the address book and update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will throw here if there is no account so it won't try to fetch/update the addressbook
@@ -14,91 +13,6 @@ describe('CreateAddressBookItemDtoSchema', () => { | |||
expect(result.success).toBe(true); | |||
}); | |||
|
|||
it('should not verify a CreateAddressBookItemDto with a shorter name', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are CreateAddressBookItemDto
tests deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a comment in a previous PR: #2151 (comment)
@iamacook suggested to just keep the tests for address book names in the address book name schema, so as not to test the same cases multiple times. I didn't remove them in that PR so removing them here.
expect(result.success).toBe(true); | ||
}); | ||
|
||
it('should not verify an UpdateAddressBookItemDto with a string id', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that we are testing Zod
validator, right?
]); | ||
}); | ||
|
||
it('should not verify an UpdateAddressBookItemDto with a malformed address', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well, it seems like we are testing the external validator library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this as it's important to ensure addresses come in correct.
]); | ||
}); | ||
|
||
it('should checksum the address of an UpdateAddressBookItemDto', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this as it's important to ensure addresses come in checksummed.
@@ -107,61 +107,6 @@ describe('AddressBookSchema', () => { | |||
]); | |||
}); | |||
|
|||
it('should not verify an AddressBookItem with a shorter name', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why are these tests deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as #2149 (comment)
Summary
This PR adds the ability to update an
AddressBookItem
by adding the following endpoint to the service:The endpoint is behind the
Accounts
scope and requires authentication.Changes
UPDATE
route for deleting anAddressBookItem
.