Skip to content

Commit

Permalink
fix(session: mysql): query bug when setting session data
Browse files Browse the repository at this point in the history
  • Loading branch information
ephrimlawrence committed Feb 29, 2024
1 parent c7d3820 commit f7f5f21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sessions/mysql.session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ export class MySQLSession extends BaseSession {

async set(sessionId: string, key: string, value: any): Promise<void> {
const [val] = await this.db.query(
`UPDATE ${this.tableName} SET data = JSON_SET(data, '$.${key}', ?) WHERE session_id = ? ${this.softDeleteQuery} RETURNING *`,
`UPDATE ${this.tableName} SET data = JSON_SET(data, '$.${key}', ?) WHERE session_id = ? ${this.softDeleteQuery}`,
[JSON.stringify(value), sessionId],
);
return val;
return await this.get(sessionId, key, value);
}

async get<T>(
Expand Down

0 comments on commit f7f5f21

Please sign in to comment.