mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
fix(api): importer job was always importing first user
We did read the actual user id from the job data, which caused us to always import the first user returned by the database.
This commit is contained in:
parent
27a7c7faf6
commit
821b91defe
1 changed files with 4 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import type { Job } from "pg-boss";
|
||||
import { Injectable, Logger } from "@nestjs/common";
|
||||
import { Span } from "nestjs-otel";
|
||||
import { ListensService } from "../../listens/listens.service";
|
||||
|
|
@ -60,7 +61,9 @@ export class SpotifyService {
|
|||
}
|
||||
|
||||
@ImportSpotifyJob.Handle()
|
||||
async importSpotifyJobHandler({ userID }: IImportSpotifyJob): Promise<void> {
|
||||
async importSpotifyJobHandler({
|
||||
data: { userID },
|
||||
}: Job<IImportSpotifyJob>): Promise<void> {
|
||||
const user = await this.usersService.findById(userID);
|
||||
if (!user) {
|
||||
this.logger.warn("User for import job not found", { userID });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue