Skip to content

Commit

Permalink
api: Fix uuid lib imports
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Jan 20, 2023
1 parent e47a8e4 commit 0dd33f0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/controllers/api-token.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Router from "express/lib/router";
import uuid from "uuid/v4";
import { v4 as uuid } from "uuid";
import sql from "sql-template-strings";

import { makeNextHREF, parseOrder, parseFilters } from "./helpers";
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/controllers/api-token.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import serverPromise from "../test-server";
import { TestClient, clearDatabase } from "../test-helpers";
import uuid from "uuid/v4";
import { v4 as uuid } from "uuid";

let server;
let mockUser;
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/controllers/object-store.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import serverPromise from "../test-server";
import { TestClient, clearDatabase } from "../test-helpers";
import uuid from "uuid/v4";
import { v4 as uuid } from "uuid";

// includes auth file tests

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/controllers/region.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import serverPromise from "../test-server";
import { TestClient, clearDatabase } from "../test-helpers";
import uuid from "uuid/v4";
import { v4 as uuid } from "uuid";
import hash from "../hash";

let server;
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/controllers/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { authorizer } from "../middleware";
import { validatePost } from "../middleware";
import Router from "express/lib/router";
import logger from "../logger";
import uuid from "uuid/v4";
import { v4 as uuid } from "uuid";
import { makeNextHREF, parseFilters, parseOrder, FieldsMap } from "./helpers";
import { db } from "../store";
import sql from "sql-template-strings";
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/store/cdn-usage-table.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DB } from "./db";
import logger from "../logger";
import uuid from "uuid/v4";
import { v4 as uuid } from "uuid";

import { CdnDataRow } from "../schema/types";

Expand Down Expand Up @@ -67,7 +67,7 @@ export class CdnUsageTable {
await client.query(
`INSERT INTO ${name} VALUES (to_timestamp($1), $2, $3, $4, $5, $6, $7, $8, $9, $10)
ON CONFLICT (date, region, playback_id)
DO UPDATE SET
DO UPDATE SET
unique_client_ips = ${name}.unique_client_ips + EXCLUDED.unique_client_ips,
total_filesize = ${name}.total_filesize + EXCLUDED.total_filesize,
total_cs_bytes = ${name}.total_cs_bytes + EXCLUDED.total_cs_bytes,
Expand All @@ -91,7 +91,7 @@ export class CdnUsageTable {
await client.query(
`INSERT INTO cdn_usage_last VALUES ($1, $2)
ON CONFLICT ((data ->> 'region'::text) )
DO UPDATE SET
DO UPDATE SET
data = EXCLUDED.data
`,
[newId, JSON.stringify({ region, fileName })]
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/store/db.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import uuid from "uuid/v4";
import { v4 as uuid } from "uuid";
import { DB } from "./db";
import Table from "./table";
import { Pool } from "pg";
Expand Down

0 comments on commit 0dd33f0

Please sign in to comment.