Skip to content

Conversation

@johnsimons
Copy link
Member

No description provided.

@johnsimons johnsimons self-assigned this Feb 7, 2024
export async function useUnarchiveMessage(ids: string[]) {
const response = await usePatchToServiceControl("errors/unarchive/", ids);
if (!response.ok) {
throw response.statusText;
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

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

Copy link
Contributor

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?

Copy link
Member Author

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}`);
Copy link
Contributor

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...

Copy link
Member Author

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) {
Copy link
Member

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

Copy link
Member Author

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) {
Copy link
Member

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?

Copy link
Member Author

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.

@johnsimons johnsimons merged commit 20af68e into master Feb 7, 2024
@johnsimons johnsimons deleted the john/tails branch February 7, 2024 22:47
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.

4 participants