Resolved ALL eslint issues for project

This commit is contained in:
2022-08-12 23:46:55 +02:00
parent 29dfe55974
commit 3594b18872
63 changed files with 1064 additions and 800 deletions

View File

@@ -3,24 +3,24 @@
<h3 class="settings__header">Change password</h3>
<form class="form">
<seasoned-input
v-model="oldPassword"
placeholder="old password"
icon="Keyhole"
type="password"
v-model="oldPassword"
/>
<seasoned-input
v-model="newPassword"
placeholder="new password"
icon="Keyhole"
type="password"
v-model="newPassword"
/>
<seasoned-input
v-model="newPasswordRepeat"
placeholder="repeat new password"
icon="Keyhole"
type="password"
v-model="newPasswordRepeat"
/>
<seasoned-button @click="changePassword">change password</seasoned-button>
@@ -34,24 +34,20 @@
import SeasonedInput from "@/components/ui/SeasonedInput.vue";
import SeasonedButton from "@/components/ui/SeasonedButton.vue";
import SeasonedMessages from "@/components/ui/SeasonedMessages.vue";
import { ErrorMessageTypes } from "../../interfaces/IErrorMessage";
import type { Ref } from "vue";
import { ErrorMessageTypes } from "../../interfaces/IErrorMessage";
import type { IErrorMessage } from "../../interfaces/IErrorMessage";
interface ResetPasswordPayload {
old_password: string;
new_password: string;
}
// interface ResetPasswordPayload {
// old_password: string;
// new_password: string;
// }
const oldPassword: Ref<string> = ref("");
const newPassword: Ref<string> = ref("");
const newPasswordRepeat: Ref<string> = ref("");
const messages: Ref<IErrorMessage[]> = ref([]);
function clearMessages() {
messages.value = [];
}
function addWarningMessage(message: string, title?: string) {
messages.value.push({
message,
@@ -64,12 +60,12 @@
return new Promise((resolve, reject) => {
if (!oldPassword.value || oldPassword?.value?.length === 0) {
addWarningMessage("Missing old password!", "Validation error");
return reject();
reject();
}
if (!newPassword.value || newPassword?.value?.length === 0) {
addWarningMessage("Missing new password!", "Validation error");
return reject();
reject();
}
if (newPassword.value !== newPasswordRepeat.value) {
@@ -77,7 +73,7 @@
"Password and password repeat do not match!",
"Validation error"
);
return reject();
reject();
}
resolve(true);
@@ -89,15 +85,14 @@
try {
validate();
} catch (error) {
console.log("not valid!");
return;
console.log("not valid!"); // eslint-disable-line no-console
}
const body: ResetPasswordPayload = {
old_password: oldPassword.value,
new_password: newPassword.value
};
const options = {};
// const body: ResetPasswordPayload = {
// old_password: oldPassword.value,
// new_password: newPassword.value
// };
// const options = {};
// fetch()
}
</script>