Skip to content

Commit

Permalink
Update link target to link id
Browse files Browse the repository at this point in the history
  • Loading branch information
NavidK0 committed Nov 13, 2020
1 parent 1937698 commit 34a8241
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/pages/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default {
save_link_changes: function () {
this.$axios.$post('/link/update', {
token: this.$store.getters['auth/get_token'],
target: this.pending_link._id,
id: this.pending_link._id,
label: this.pending_link.label,
subtitle: this.pending_link.subtitle,
url: this.pending_link.url,
Expand Down
6 changes: 3 additions & 3 deletions server/src/controllers/link-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ export class LinkController implements Controller {
async UpdateLink(request: AuthenticatedRequest, reply: FastifyReply) {
let json: any = request.body;

if (!json.target) {
return reply.status(400).send(ReplyUtils.error("No target was provided."));
if (!json.id) {
return reply.status(400).send(ReplyUtils.error("No id was provided."));
}

let link = await this.linkService.updateLink(
json.target,
json.id,
json.url,
json.order,
json.label,
Expand Down

0 comments on commit 34a8241

Please sign in to comment.