-
Notifications
You must be signed in to change notification settings - Fork 26
Migrating more composables and a few vue files #1702
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
Conversation
| export async function useUnarchiveMessage(ids: string[]) { | ||
| const response = await usePatchToServiceControl("errors/unarchive/", ids); | ||
| if (!response.ok) { | ||
| throw response.statusText; |
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 think we should implement https://eslint.org/docs/latest/rules/no-throw-literal
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.
Added rule and updated code accordingly
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.
but you missed this line?
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 did!
|
|
||
| //edit or create note by group id | ||
| export async function useEditOrCreateNote(groupId: string, comment: string) { | ||
| const response = await usePostToServiceControl(`recoverability/groups/${groupId}/comment?comment=${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.
the following functions are identical except for the url, could extract...
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 have tidy this a little bit
| getRedirect(); | ||
| } else { | ||
| redirectSaveSuccessful.value = false; | ||
| if (result.status === "409" || result.status === 409) { |
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'm guessing this is TypeScript telling us this can only be a number
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.
yes I typed the status to be a number
| try { | ||
| const response = await useArchiveMessage([id.value]); | ||
| if (response !== undefined) { | ||
| if (response.data.ok) { |
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.
This must be ok or we would have thrown, right?
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.
You are right @mikeminutillo.
I refactored the code to get rid of that, and also removed the catch->console.log while I was there.
No description provided.