@@ -9,7 +9,7 @@ import { deleteIntraScore, intraScoreSyncingPossible, syncIntraScore, syncTotalC
99const SCORES_PER_PAGE = 100 ;
1010
1111interface ScoreHistoryFilter {
12- field : 'login' | 'type' | 'intra_type_id' | 'date' | 'coalition' | 'reason' | 'none' ;
12+ field : 'login' | 'type' | 'intra_type_id' | 'date' | 'coalition' | 'reason' | 'intra_score_id' | ' none';
1313 value ?: string ;
1414} ;
1515
@@ -214,6 +214,25 @@ export const setupAdminPointsRoutes = function(app: Express, prisma: PrismaClien
214214 } ) ;
215215 } ) ;
216216
217+ app . get ( '/admin/points/history/intra_score_id/:intraScoreId' , async ( req , res ) => {
218+ const intraScoreId = req . params . intraScoreId ;
219+
220+ if ( ! intraScoreId || intraScoreId === "null" ) {
221+ return getScoreHistory ( req , res , prisma , {
222+ intra_score_id : null ,
223+ } , { field : 'intra_score_id' , value : "null" } ) ;
224+ }
225+
226+ const parsedIntraScoreId = parseInt ( intraScoreId ) ;
227+ if ( isNaN ( parsedIntraScoreId ) ) {
228+ return res . status ( 400 ) . send ( 'Invalid Intra Score ID' ) ;
229+ }
230+
231+ return getScoreHistory ( req , res , prisma , {
232+ intra_score_id : parsedIntraScoreId ,
233+ } , { field : 'intra_score_id' , value : intraScoreId } ) ;
234+ } ) ;
235+
217236 app . get ( '/admin/points/history/:id' , async ( req , res ) => {
218237 const scoreId = parseInt ( req . params . id ) ;
219238 if ( isNaN ( scoreId ) ) {
0 commit comments