Skip to content

Commit

Permalink
Refactored tiny issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zooldeveloper committed Aug 21, 2022
1 parent fbcddc2 commit 07a4c3a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const userRoutes = require('./routes/user');
const postRoutes = require('./routes/post');
const likeRoutes = require('./routes/like');
const commentRoutes = require('./routes/comment');
const usersRoutes = require('./routes/users')
const subscribersRoutes = require('./routes/subscribe')
const usersRoutes = require('./routes/users');
const subscribersRoutes = require('./routes/subscribe');


const app = express();
Expand Down
3 changes: 1 addition & 2 deletions backend/controllers/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const db = require('../config/database');
exports.createAndUpdateSubscribers = (req, res) => {

const { subscriber_status, profile_owner, subscribed_user } = req.body;
console.log(req.body)
if (subscriber_status === 'true') {
// Selects the subscriber_status column that matches the conditions
db.query('SELECT subscriber_status FROM subscribers WHERE profile_owner = ? AND subscribed_user = ?',
Expand Down Expand Up @@ -41,7 +40,7 @@ exports.createAndUpdateSubscribers = (req, res) => {
if (err) {
return res.status(500).send(err);
}
res.status(200).json({ message: "Vous êtes plus abonné !" });
res.status(200).json({ message: "Vous n'êtes plus abonné !" });
});
}

Expand Down
7 changes: 5 additions & 2 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<template>
<div id="app">
<router-view/>
</div>
</template>


Expand Down Expand Up @@ -31,4 +29,9 @@ export default {
max-width: 800px;
margin: 0 auto;
}
#notification {
margin-top: 90px;
}
</style>
2 changes: 1 addition & 1 deletion frontend/src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
if(this.$store.state.user[0].imageUrl) {
this.imageUrl = this.$store.state.user[0].imageUrl;
}
}, 100)
}, 70)
},
unmounted() {
window.removeEventListener('resize', this.handleResize);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SubscribeBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: 'SubscribeBtn',
props: {
icon: {
type: Boolean,
type: String,
required: true,
},
color: {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Entry from '../views/Entry'

Expand Down Expand Up @@ -39,7 +39,7 @@ const routes = [
];

const router = createRouter({
history: createWebHashHistory(),
history: createWebHistory(),
routes
})

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default createStore({
comments: {},
users: {},
subscribers: {},
primaryColor: '#f08e8a',
secondaryColor: '#f08e8a'
},
mutations: {
SUCCESS_MESSAGE(state, message) {
Expand Down Expand Up @@ -225,7 +227,7 @@ export default createStore({
//Makes the get request of all users posts
async getAllPosts({ commit }) {
try {
let result = await instance.get('/posts');
const result = await instance.get('/posts');
if (result.status === 200) {
commit('GET_ALL_POSTS', result.data);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
v-if="successResMsg !== null"
:successResMsg="successResMsg"
/>
<h1>Profil</h1>
<h1>Account</h1>
<UserProfile
:userImage="currentUser.imageUrl ? currentUser.imageUrl : userImage "
:userFirstName="currentUser.firstName"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
if(this.posts[i].id == this.userOnSearchQuery.id) {
this.isUserGotPost = true;
}
}
},
onSubscribe(currentUser, clickedUser) {
Expand Down

0 comments on commit 07a4c3a

Please sign in to comment.