Skip to content

Commit

Permalink
Added JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-elhaddad committed Oct 13, 2023
1 parent 1671b51 commit 12d8a83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/helpers/generateListURL.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import jwt from 'jsonwebtoken';
import { config } from './../configuration/config';

/**
* Generates a URL to share a list with a token.
* @returns URL to share a list.
*/
const shareList = (l_id: number): string => {
const token = jwt.sign(String(l_id), config.jwtSecretKey);
const url = `http://localhost:3000/lists/${token}`;
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/setTaskPriority.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Task from './../types/Task.type';

/**
* Sets the priority of the task from string to a number.
*/
const setTaskPriority = (task: Task) => {
if (task.t_priority) {
if (task.t_priority === 'low') task.t_priority = 1;
Expand Down

0 comments on commit 12d8a83

Please sign in to comment.