-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
34 lines (32 loc) · 813 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { userJoinArrange } = require("./src/lib/arrange");
const { User, Playlist, Music } = require("./src/models");
(async() => {
const user = await User.findOne({
where : {
id: 27
},
include: [
{
model: Playlist,
attributes: ['pId'],
as: 'playlists'
},
{
model: Music,
attributes: ['id'],
as: 'liked',
},
{
model: User,
attributes: ['id'],
as: 'followings',
},
{
model: User,
attrbiutes: ['id'],
as: 'followers'
},
],
});
console.log(userJoinArrange(user));
})();