| 1 | const connection = require('../app/database'); |
| 2 | |
| 3 | class AuthService { |
| 4 | async checkResource(tableName, id, userId) { |
| 5 | const statement = `SELECT * FROM ${tableName} WHERE id = ? AND user_id = ?;`; |
| 6 | const [result] = await connection.execute(statement, [id, userId]); |
| 7 | return result.length === 0 ? false: true; |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | module.exports = new AuthService(); |
nothing calls this directly
no outgoing calls
no test coverage detected