Skip to content

Conversation

Adrito-M
Copy link

@Adrito-M Adrito-M commented Jul 3, 2022

CSOC Task 3 Vue Submission

Deployed Site
Repo Link

I have completed the following tasks

  • Auth Middleware
  • Login Function
  • Add task
  • Get tasks
  • Update Task
  • Delete Task
  • UI Improvement

Extra Stuff:

Added a search functionality for the todos, for ease of finding and then deleting/updating todos

</main>
</template>

<script lang>
import { defineComponent } from '@nuxtjs/composition-api'
import addTask from '~/components/addTask.vue'
import axios from 'axios'
import Search from '~/components/search.vue';
const API_BASE_URL = 'https://todo-app-csoc.herokuapp.com/';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also create a configuration for the default request header since the base URL is being used all over the project.

https://axios-http.com/docs/config_defaults

})
</script>

<style>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of transitions :)

@@ -0,0 +1,51 @@
<template>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Feature!

* @hints check what propeties context has
*/
export default defineNuxtMiddleware(({store, route, redirect}) => {
if (store.getters.auth && (route.path === '/login' || route.path === '/register')) return redirect('/')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could have used variables for path and auth token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants