Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.

Commit 302efca

Browse files
authored
Merge pull request #67 from WildCodeSchool/feature/fix
fix bug
2 parents e960cf1 + 323a797 commit 302efca

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/backend/api/src/artists-hired/artists-hired.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,13 @@ artistsHiredRouter.post('/', async (req: Request, res) => {
3131
return;
3232
}
3333

34-
await db
34+
const artistsHiredId = await db
3535
.insertInto('artists_hired')
3636
.values({
3737
artists_id: artistId,
3838
milestones_id: artist.milestones_id,
3939
notoriety: artist.notoriety,
4040
})
41-
.execute();
42-
43-
const artistsHiredId = await db
44-
.selectFrom('artists_hired')
45-
.select('id')
46-
.where('artists_hired.artists_id', '=', artistId)
47-
.limit(1)
4841
.executeTakeFirst();
4942

5043
if (!artistsHiredId) {
@@ -58,7 +51,7 @@ artistsHiredRouter.post('/', async (req: Request, res) => {
5851
.insertInto('label_artists')
5952
.values({
6053
label_id: labelId,
61-
artists_hired_id: Number(artistsHiredId.id),
54+
artists_hired_id: Number(artistsHiredId.insertId),
6255
})
6356
.execute();
6457

0 commit comments

Comments
 (0)