diff --git a/resources/css/app.css b/resources/css/app.css
index c1b8af1..d82198a 100644
--- a/resources/css/app.css
+++ b/resources/css/app.css
@@ -1,9 +1,18 @@
.link-no-decor {
- color: white;
- text-decoration: none;
- cursor: pointer;
+ color: white!important;
+ text-decoration: none!important;
+ cursor: pointer!important;
}
.link-no-decor:hover {
- color: #093160;
+ color: #093160!important;
+}
+
+.cursor-pointer {
+ cursor: pointer!important;
+}
+
+.card-bg {
+ background-color: #212022!important;
+ color: white!important;
}
diff --git a/resources/store/wish.js b/resources/store/wish.js
index 100c4d7..7d53ba6 100644
--- a/resources/store/wish.js
+++ b/resources/store/wish.js
@@ -9,15 +9,15 @@ export const useWishStore = defineStore('wish', {
pushWish(wish){
this.wishesList.push(wish);
},
- async getUserWishes(user_id, token){
+ async getUserWishes(user_id){
let result = null;
await axios.get(`/api/wish/user_wishes/${user_id.toString()}`,
- {
- headers: {
- Authorization: `Bearer ${token}`,
- token: token
- }
- }
+ // {
+ // headers: {
+ // Authorization: `Bearer ${token}`,
+ // token: token
+ // }
+ // }
).then((response)=>{
result = response.data;
});
@@ -42,6 +42,21 @@ export const useWishStore = defineStore('wish', {
newWish = {status: response.status, statusText: response.statusText, data: response.data};
});
return newWish;
+ },
+ async remove(id, token){
+ await axios.post(`/api/wish/destroy`,
+ {
+ id: id
+ },
+ {
+ headers: {
+ Authorization: `Bearer ${token}`,
+ token: token
+ },
+ }
+ ).then((response)=>{
+ return response;
+ });
}
},
})
diff --git a/resources/views/Auth/Login.vue b/resources/views/Auth/Login.vue
index 3a60f92..adff294 100644
--- a/resources/views/Auth/Login.vue
+++ b/resources/views/Auth/Login.vue
@@ -12,15 +12,31 @@ export default {
data: () => ({
userStore: useUserStore(),
valid: false,
- email: '',
- password: '',
+ email: null,
+ password: null,
rememberMe: false,
errorMessage: '',
errorMessageContainerStyle: '',
showPassword: false
}),
methods: {
+ validate(){
+ let emailValidation = rules.email(this.email);
+ let passwordValidation = rules.notNull(this.password);
+ if (typeof emailValidation == "boolean" && typeof passwordValidation == "boolean"){
+ return emailValidation && passwordValidation;
+ } else if (typeof emailValidation == "string") {
+ return emailValidation;
+ } else if (typeof passwordValidation == "string") {
+ return passwordValidation;
+ }
+ },
loginAction(){
+ let validation = this.validate();
+ if (validation !== true){
+ alert(validation);
+ return;
+ }
this.userStore.login(this.email, this.password, this.rememberMe).then((isLogged) => {
if (typeof isLogged == "boolean") {
if (isLogged){
diff --git a/resources/views/Auth/Registration.vue b/resources/views/Auth/Registration.vue
index 7a475ae..7cfa62c 100644
--- a/resources/views/Auth/Registration.vue
+++ b/resources/views/Auth/Registration.vue
@@ -7,10 +7,10 @@ export default {
data: () => ({
userStore: useUserStore(),
valid: false,
- login: '',
- email: '',
- password: '',
- repeatPassword: '',
+ login: null,
+ email: null,
+ password: null,
+ repeatPassword: null,
errorMessage: '',
errorMessageContainerStyle: 'display: none;',
showPassword: false,
@@ -22,7 +22,26 @@ export default {
}
},
methods: {
+ validate(){
+ let emailValidation = rules.email(this.email);
+ let loginValidation = rules.notNull(this.login);
+ let passwordValidation = rules.notNull(this.password);
+ let repeatPasswordValidation = rules.notNull(this.repeatPassword);
+ let validation = [emailValidation, loginValidation, passwordValidation, repeatPasswordValidation];
+ let check = null;
+ validation.forEach((element)=>{
+ if (typeof element !== "boolean"){
+ check = element;
+ }
+ })
+ return check === null ? true : check;
+ },
registrationAction(){
+ let validation = this.validate();
+ if (validation !== true){
+ alert(validation);
+ return;
+ }
this.userStore.registration(this.login, this.email, this.password, this.repeatPassword).then((isRegistred)=>{
if (typeof isRegistred == "boolean") {
if (isRegistred){
diff --git a/resources/views/Welcome.vue b/resources/views/Welcome.vue
index bd842a9..c197459 100644
--- a/resources/views/Welcome.vue
+++ b/resources/views/Welcome.vue
@@ -63,9 +63,4 @@ export default {
height: 100vh;
}
-.card-bg {
- background-color: #212022;
- color: white;
-}
-
diff --git a/resources/views/Wishlist/CreateWish.vue b/resources/views/Wishlist/CreateWish.vue
new file mode 100644
index 0000000..262c491
--- /dev/null
+++ b/resources/views/Wishlist/CreateWish.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+ Создать новый элемент
+
+
+
+
+
+
+
+
+ Создать
+
+
+
+
+
diff --git a/resources/views/Wishlist/Wishlist.vue b/resources/views/Wishlist/Wishlist.vue
index b0b2f61..01191b1 100644
--- a/resources/views/Wishlist/Wishlist.vue
+++ b/resources/views/Wishlist/Wishlist.vue
@@ -1,36 +1,87 @@
- Hello world!
+
+
+
+
+
+ Наименование |
+ Цена |
+ Ссылка |
+ |
+ |
+
+
+
+
+ {{ wish['name'] }} |
+ {{ wish['price'] }} |
+ {{ wish['url'] }} |
+ |
+ |
+
+
+ |
+
+
+
+
+
+