CCM-18132: Get proofing request by ID endpoint#960
Conversation
…te-proof-request-endpoint
|
|
||
| expect(result).toEqual({ | ||
| statusCode: 200, | ||
| data: expect.objectContaining({ |
There was a problem hiding this comment.
I think it's better to assert the whole object here, instead of using objectContaining
| }); | ||
| }); | ||
|
|
||
| test.describe('auth', () => { |
There was a problem hiding this comment.
Could you add a test similar to returns 404 if contact detail is owned by a different user in tests/test-team/template-mgmt-api-tests/create-proofing-request.api.spec.ts where a different user belonging to the same client is shown to not be able to access the request?
| }' | ||
| ``` | ||
|
|
||
| ### GET - /v1/proofing-request/:proofingRequestId - Get a digital proofing request. by id |
There was a problem hiding this comment.
This doesn't make sense and it's interrupting 'POST - /v1/template/:templateId/proofing-request' halfway through
| } | ||
| } | ||
|
|
||
| private getOwnerKey(user: User) { |
There was a problem hiding this comment.
this can be used within put too
| proofingRequestId: string, | ||
| user: User | ||
| ): Promise<ApplicationResult<ProofRequest>> { | ||
| return await this.proofRequestRepository.getById(proofingRequestId, user); |
There was a problem hiding this comment.
I think we may need to check for the digital proofing feature flag here as well. It feels slightly overkill on the GET but is consistent with how I'd expect a feature flag to behave. You shouldn't be able to fetch resources you haven't been granted permission to
There was a problem hiding this comment.
This wasn't done for contact details
| expect(result).toEqual({ data: proofRequest }); | ||
| }); | ||
|
|
||
| it('returns 404 when proofing request is not found', async () => { |
There was a problem hiding this comment.
I don't think we need this test, because the 404 specific behavior belongs to the repository.
returns error when repository lookup fails could be re-worded to be more generic: returns error when repository returns error
Description
This endoint is aimed at returning a proofing request data by using it ID (which is provided in the URL)
Context
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.