File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
- import { Injectable , NotFoundException } from '@nestjs/common' ;
1
+ import {
2
+ ConflictException ,
3
+ Injectable ,
4
+ NotFoundException ,
5
+ } from '@nestjs/common' ;
2
6
import { InjectRepository } from '@nestjs/typeorm' ;
3
7
import { TilawaSurah } from 'src/surah/entities/tilawa-surah.entity' ;
4
8
import { Repository } from 'typeorm' ;
@@ -26,6 +30,10 @@ export class AudioService {
26
30
) : Promise < TilawaSurah & { reciter_id : number } > {
27
31
const { surah_id, reciter_id } = paginatedFilter ;
28
32
let tilawa_id = paginatedFilter . tilawa_id ;
33
+ console . log ( tilawa_id ) ;
34
+
35
+ if ( ! reciter_id && ! tilawa_id )
36
+ throw new ConflictException ( 'Reciter or Tilawa are required' ) ;
29
37
30
38
if ( ! tilawa_id ) {
31
39
const tilawa = await this . reciterService . getReciterTilawa ( reciter_id ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export class FilterAudioDto {
8
8
9
9
@IsNumber ( )
10
10
@Transform ( ( { value } ) => parseInt ( value ) )
11
+ @IsOptional ( )
11
12
reciter_id : number ;
12
13
13
14
@IsNumber ( )
You can’t perform that action at this time.
0 commit comments