Update Database Tables #3

Merged
clement.freville2 merged 12 commits from update-bdd into main 10 months ago
Owner

Update Database Tables

User

Tables

  • Add the email field

API

  • Add a route to update the email

Work

Tables

  • Add the title
  • Add date fields

API

  • Add a route to update the title (/works/:id/title)
  • Add a route to update the content (/works/:id/content)
# Update Database Tables ## User ### Tables + Add the email field ### API + Add a route to update the email ## Work ### Tables + Add the title + Add date fields ### API + Add a route to update the title (/works/:id/title) + Add a route to update the content (/works/:id/content)
colin.frizot added 2 commits 11 months ago
continuous-integration/drone/push Build is passing Details
a9651ed09f
Add an email to User and title, date to Work
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
9c194b218d
Add the update of the title and the content
clement.freville2 requested review from clement.freville2 11 months ago
clement.freville2 requested changes 11 months ago
src/server.ts Outdated
const { id } = request.params;
const { newEmail } = request.body;
await db.updateUserEmail(database, id, newEmail);
reply.send({ success: true });

You should check if the ID relates to an existing ID.

You should check if the ID relates to an existing ID.
clement.freville2 marked this conversation as resolved
src/server.ts Outdated
id_language: Type.Number(),
title: Type.String(),
code: Type.String(),
date: Type.String(),

The user should not be able to set the date, it should use the current date and time.

The user should not be able to set the date, it should use the current date and time.
clement.freville2 marked this conversation as resolved
src/server.ts Outdated
const { id_user, link, id_language, code } = request.body;
db.insertWork(database, link, id_user, id_language, code);
const { id_user, link, id_language, title, code, date } = request.body;
db.insertWork(database, link, id_user, id_language, title, code, date);
-    db.insertWork(database, link, id_user, id_language, title, code, date);
+    await db.insertWork(database, link, id_user, id_language, title, code, date);
```diff - db.insertWork(database, link, id_user, id_language, title, code, date); + await db.insertWork(database, link, id_user, id_language, title, code, date); ```
clement.freville2 marked this conversation as resolved
src/server.ts Outdated
async (request, reply) => {
const { id } = request.params;
const { newTitle } = request.body;
db.updateWorkTitle(database, id, newTitle);
-    db.updateWorkTitle(database, id, newTitle);
+    await db.updateWorkTitle(database, id, newTitle);
```diff - db.updateWorkTitle(database, id, newTitle); + await db.updateWorkTitle(database, id, newTitle); ```
clement.freville2 marked this conversation as resolved
src/server.ts Outdated
async (request, reply) => {
const { id } = request.params;
const { newContent } = request.body;
db.updateWorkContent(database, id, newContent);
-    db.updateWorkContent(database, id, newContent);
+    await db.updateWorkContent(database, id, newContent);
```diff - db.updateWorkContent(database, id, newContent); + await db.updateWorkContent(database, id, newContent); ```
clement.freville2 marked this conversation as resolved
colin.frizot added 1 commit 11 months ago
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
27778a68f4
Add await to the calls and add the date by default
colin.frizot requested review from clement.freville2 11 months ago
clement.freville2 approved these changes 11 months ago
clement.freville2 left a comment
Owner

Great!

Great!
clement.freville2 force-pushed update-bdd from 27778a68f4 to 0e352a37d0 11 months ago
clement.freville2 force-pushed update-bdd from 0e352a37d0 to 99b29432cd 11 months ago
matis.mazingue added 1 commit 11 months ago
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
10c9d5e41b
Merge branch 'update-bdd' of https://codefirst.iut.uca.fr/git/sandkasten/labyrinth into update-bdd
matis.mazingue added 1 commit 11 months ago
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
aa0516dc72
selectWorkById et selectLastWorkByUserId
clement.freville2 added 1 commit 10 months ago
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
b22caee202
Remove trailing whitespaces
matis.mazingue added 2 commits 10 months ago
matis.mazingue added 1 commit 10 months ago
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
1240b3ebe7
delete table language + delete getLastLinkWorkByUSerId
colin.frizot added 1 commit 10 months ago
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
f9b0fb5e10
Change the get and add link
matis.mazingue requested review from clement.freville2 10 months ago
clement.freville2 added 1 commit 10 months ago
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
3dabedd89b
Merge branch 'main' into update-bdd
clement.freville2 merged commit 96bb32ac32 into main 10 months ago
clement.freville2 referenced this issue from a commit 10 months ago
clement.freville2 deleted branch update-bdd 10 months ago

Reviewers

clement.freville2 was requested for review 10 months ago
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
The pull request has been merged as 96bb32ac32.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: sandkasten/labyrinth#3
Loading…
There is no content yet.