Skip to content

Commit

Permalink
change script for insert data for auth test in ESLint format
Browse files Browse the repository at this point in the history
  • Loading branch information
Danspb77 committed Nov 3, 2023
1 parent c04144e commit 148f0a7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/tests/utils/insert-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type SequelizeOrm from '@repository/storage/postgres/orm/index.js';
import users from '../test-data/users.json';
import notes from '../test-data/notes.json';
import noteSettings from '../test-data/notes-settings.json';
import tokens from '../test-data/tokens.json'
import tokens from '../test-data/tokens.json';

/**
* Fills in the database with users data
Expand Down Expand Up @@ -43,10 +43,9 @@ async function insertNoteSettings(db: SequelizeOrm): Promise<void> {
* @param db - SequelizeOrm instance
*/
async function insertTokens(db:SequelizeOrm): Promise<void> {
for(const token of tokens){
await db.connection.query(`INSERT INTO public.user_sessions("id","user_id","refresh_token","refresh_token_expires_at") VALUES (${token.Id}, ${token.user_Id}, '${token.refreshToken}', '${token.refresh_token_expires_at}')`)
for (const token of tokens) {
await db.connection.query(`INSERT INTO public.user_sessions("id","user_id","refresh_token","refresh_token_expires_at") VALUES (${token.Id}, ${token.user_Id}, '${token.refreshToken}', '${token.refresh_token_expires_at}')`);
}

}

/**
Expand Down

0 comments on commit 148f0a7

Please sign in to comment.