This commit is contained in:
@@ -251,6 +251,10 @@ export class FeederPersistenceService {
|
||||
if (existingLeague) {
|
||||
// If exists with different ID, use existing ID to prevent constraint errors
|
||||
finalLeagueId = existingLeague.id;
|
||||
// Update sortOrder if changed
|
||||
if (league.sortOrder !== undefined) {
|
||||
await tx.$executeRaw`UPDATE leagues SET sort_order = ${league.sortOrder} WHERE id = ${finalLeagueId}`;
|
||||
}
|
||||
} else {
|
||||
// Create new league
|
||||
await tx.league.create({
|
||||
@@ -261,8 +265,11 @@ export class FeederPersistenceService {
|
||||
sport: sport,
|
||||
competitionSlug: league.competitionSlug,
|
||||
logoUrl: `/uploads/competitions/${finalLeagueId}.png`,
|
||||
},
|
||||
} as any,
|
||||
});
|
||||
if (league.sortOrder !== undefined) {
|
||||
await tx.$executeRaw`UPDATE leagues SET sort_order = ${league.sortOrder} WHERE id = ${finalLeagueId}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user