We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bdfd5e commit b968704Copy full SHA for b968704
src/api/index.ts
@@ -95,6 +95,17 @@ export const routes = {
95
)
96
return spotifyAccessToken
97
},
98
+
99
+ async setSpotifyToken(id: string, token: SpotifyAccessToken) {
100
+ const tokensTable = em.getRepository(Token)
101
102
+ const oldToken = await tokensTable.findOne(parseInt(id))
103
+ if (oldToken) {
104
+ oldToken.spotifyAccessToken = JSON.stringify(token)
105
+ await em.flush()
106
+ }
107
+ return
108
109
}
110
111
export const init = async (port: number) => {
0 commit comments