-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup #39
base: main
Are you sure you want to change the base?
setup #39
Conversation
1. set login and register 2. set crud endpoints in client: 1. init template index.html and css
static delTask(req, res, next) { | ||
Task.findByPk(+req.params.id) | ||
.then(data => { | ||
if (data.UserId == req.userLogIn.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ini ga perlu yah ,
kan udah diprotect di middleware authorization
} | ||
Task.findByPk(+req.params.id) | ||
.then(data => { | ||
if (data.UserId == req.userLogIn.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ini juga
server/middlewares/authorization.js
Outdated
Task.findOne({where: { | ||
id: req.params.id | ||
}}) | ||
.then(todo => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo?? 😆
Task.belongsTo(models.User) | ||
} | ||
}; | ||
Task.init({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validasi yah
User.hasMany(models.Task) | ||
} | ||
}; | ||
User.init({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validasi juga yah
1. log in and register 2. navbar and main page 3. crud card task
berikut isi file .env ku kak: |
1. generate model category 2. add new routing /categories 3. add button add category
in server:
in client: