u
This commit is contained in:
13
src/store/google_auth/getByEmail.js
Normal file
13
src/store/google_auth/getByEmail.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import sql from 'mssql';
|
||||
import { GET_BY_EMAIL } from '../../sql/google_auth.js';
|
||||
|
||||
export default function getByEmail(pool) {
|
||||
return async (email) => {
|
||||
const result = await pool
|
||||
.request()
|
||||
.input('email', sql.NVarChar(320), email)
|
||||
.query(GET_BY_EMAIL);
|
||||
|
||||
return result.recordset[0];
|
||||
};
|
||||
}
|
||||
13
src/store/google_auth/getById.js
Normal file
13
src/store/google_auth/getById.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import sql from 'mssql';
|
||||
import { GET_BY_ID } from '../../sql/google_auth.js';
|
||||
|
||||
export default function getById(pool) {
|
||||
return async (id) => {
|
||||
const result = await pool
|
||||
.request()
|
||||
.input('id', sql.Int, id)
|
||||
.query(GET_BY_ID);
|
||||
|
||||
return result.recordset[0];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user