-
Notifications
You must be signed in to change notification settings - Fork 32
Queued Transfer Footer Component #2254
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
Queued Transfer Footer Component #2254
Conversation
| export async function updateQueuedTransfer ( | ||
| reviewId: string, payload: any | ||
| ): Promise<QueueDetailIF | any> { | ||
| try { | ||
| const response = await axios.patch<QueueDetailIF>( | ||
| `reviews/${reviewId}`, | ||
| payload, | ||
| getDefaultConfig() | ||
| ) | ||
| const data: QueueDetailIF = response?.data | ||
| if (!data) { | ||
| throw new Error('Invalid API response') | ||
| } | ||
| return data | ||
| } catch (error: AxiosError | any) { | ||
| if (error.response && error.response.status === 404) { | ||
| console.error('Resource not found:', error.message) | ||
| // Handle 404 gracefully, returning null | ||
| return null | ||
| } else { | ||
| // Handle other errors differently if needed | ||
| console.error('API Error:', error.message) | ||
| throw error | ||
| } | ||
| } | ||
| } |
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.
Maybe include a payload IF, even if it's a simple interface inline.
ie payload: { statusType: ReviewStatusTypes }
QQ: The assignee value (ie current user) is captured and applied api side?
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.
Yep, I will add type for the payload.
Answer: If the assignee value is empty, the staff user submitting the request is the assignee.
cameron-eyds
left a 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.
Spectacular! Just one comment/question.
doug-lovett
left a 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.
Excellent.
Issue #: /bcgov/entity#20492
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the PPR license (Apache 2.0).