Skip to content

Commit

Permalink
Merge pull request #1 from Patrick-ring-motive/main
Browse files Browse the repository at this point in the history
Cheese
  • Loading branch information
philwing100 authored Dec 4, 2024
2 parents a24f49f + 1a409e2 commit ab74308
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function createList(listData) {
);
return response.data;
} catch (error) {
console.error('Error creating list:', error);
console.warn('Error creating list:', error,...arguments);
throw error;
}
}
Expand All @@ -42,7 +42,7 @@ export async function deleteList(listId) {
});
return response.data;
} catch (error) {
console.error('Error deleting list:', error);
console.warn('Error deleting list:', error,...arguments);
throw error;
}
}
7 changes: 1 addition & 6 deletions src/components/ListItems/MinuteInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ export default {
methods: {
validateInput(event) {
const num = Number(event.target.value);
if (isNaN(num) || num <= 0) {
this.minutes = ''; // Reset to empty if invalid
} else {
this.minutes = num; // Set valid number as minutes
}
this.minutes = (num > 0 ? num : '');
// Emit update:modelValue to enable two-way binding
this.$emit('update:modelValue', String(this.minutes));
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const router = createRouter({
});

// Navigation guard for protected routes
router.beforeEach((to, from, next) => {
router.beforeEach(function beforeEach(to, from, next) {
const isAuthenticated = store.state.isAuthenticated; // Get auth status from Vuex

if (to.matched.some(record => record.meta.requiresAuth)) {
Expand Down
4 changes: 2 additions & 2 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const store = createStore({
commit('SET_SESSION_ID', sessionId);
}
} catch (error) {
console.error('Not authenticated:', error);
console.warn('Not authenticated:', error,...arguments);
commit('LOGOUT');
}
},
Expand All @@ -45,7 +45,7 @@ const store = createStore({
await axios.post('/auth/logout');
commit('LOGOUT');
} catch (error) {
console.error('Logout error:', error);
console.warn('Logout error:', error,...arguments);
}
},
},
Expand Down

0 comments on commit ab74308

Please sign in to comment.