Passed
Pull Request — main (#12)
by Julia
02:09
created

server/src/models/card.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 20
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
mnd 0
bc 0
fnc 2
dl 0
loc 20
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import { db } from "./db.js"
2
3
4
const card = {
5
    getTypes: async function() {
6
        const result = await db.queryNoArgs(`CALL card_types();`);
7
        return result[0];
8
    },
9
    /**
10
     * 
11
     * @param {Int} userId 
12
     * @returns {Objetct}
13
     */
14
    userDetails: async function(userId) {
15
        const result = await db.queryWithArgs(`CALL user_card(?);`, [userId]);
16
        return result[0][0];
17
    }
18
}
19
20
export default card;
21