Skip to content

Commit

Permalink
update repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ledyba committed May 10, 2022
1 parent 28aed81 commit 2c329a4
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions server/src/repo/Repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,27 +164,21 @@ delete from entities where "id" = $1;
update entities set
"medium_id" = $2,
"icon_id" = $3,
"timestamp" = $4,
"type" = $5,
"mime_type" = $6,
"width" = $7,
"height" = $8,
"duration" = $9
"type" = $4,
"mime_type" = $5,
"width" = $6,
"height" = $7,
"duration" = $8
where
"id" = $1
`;
const timestamp =
entity.timestamp != undefined ?
entity.timestamp.toDate() :
null;
let r;
switch (entity.type) {
case 'image': {
r = await this.pool.query(q, [
entity.id,
entity.mediumID,
entity.iconID,
timestamp,
'image',
entity.mimeType,
entity.width,
Expand All @@ -198,7 +192,6 @@ where
entity.id,
null,
entity.iconID,
timestamp,
'video',
entity.mimeType,
entity.width,
Expand All @@ -211,7 +204,6 @@ where
entity.id,
null,
entity.iconID,
timestamp,
'audio',
entity.mimeType,
null,
Expand Down

0 comments on commit 2c329a4

Please sign in to comment.