Fix a typescript issue with catch variable type

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-09-29 18:20:33 +02:00
parent 7bf745edf7
commit dc52cd042b
27 changed files with 87 additions and 75 deletions

View File

@@ -174,7 +174,7 @@ export default class CreateGroup extends mixins(IdentityEditionMixin) {
displayName: this.group.displayName(),
}) as string
);
} catch (err) {
} catch (err: any) {
this.handleError(err);
}
}

View File

@@ -704,7 +704,7 @@ export default class Group extends mixins(GroupMixin) {
},
],
});
} catch (error) {
} catch (error: any) {
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.$notifier.error(error.graphQLErrors[0].message);
}
@@ -754,7 +754,7 @@ export default class Group extends mixins(GroupMixin) {
this.$notifier.success(
this.$t("Group {groupTitle} reported", { groupTitle }) as string
);
} catch (error) {
} catch (error: any) {
console.error(error);
this.$notifier.error(
this.$t("Error while reporting group {groupTitle}", {

View File

@@ -246,7 +246,7 @@ export default class GroupFollowers extends mixins(GroupMixin) {
username: follower.actor.preferredUsername,
});
this.$notifier.success(message as string);
} catch (error) {
} catch (error: any) {
console.error(error);
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.$notifier.error(error.graphQLErrors[0].message);

View File

@@ -335,7 +335,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
}) as string
);
this.newMemberUsername = "";
} catch (error) {
} catch (error: any) {
console.error(error);
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.inviteError = error.graphQLErrors[0].message;
@@ -402,7 +402,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
group: this.group.name || usernameWithDomain(this.group),
}) as string
);
} catch (error) {
} catch (error: any) {
console.error(error);
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.$notifier.error(error.graphQLErrors[0].message);
@@ -458,7 +458,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
successMessage = "The member role was updated to simple member";
}
this.$notifier.success(this.$t(successMessage) as string);
} catch (error) {
} catch (error: any) {
console.error(error);
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.$notifier.error(error.graphQLErrors[0].message);

View File

@@ -238,7 +238,7 @@ export default class GroupSettings extends mixins(GroupMixin) {
variables,
});
this.$notifier.success(this.$t("Group settings saved") as string);
} catch (err) {
} catch (err: any) {
this.handleError(err);
}
}

View File

@@ -156,7 +156,7 @@ export default class MyGroups extends Vue {
},
],
});
} catch (error) {
} catch (error: any) {
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
this.$notifier.error(error.graphQLErrors[0].message);
}