|
Lines 703-711
sub add {
Link Here
|
| 703 |
} |
703 |
} |
| 704 |
) unless !$duplicatebiblionumber || $confirm_not_duplicate; |
704 |
) unless !$duplicatebiblionumber || $confirm_not_duplicate; |
| 705 |
|
705 |
|
| 706 |
my ( $biblio_id ) = AddBiblio( $record, $frameworkcode, { record_source_id => $record_source_id } ); |
706 |
my ($biblio_id) = C4::Biblio::AddBiblio( $record, $frameworkcode, { record_source_id => $record_source_id } ); |
| 707 |
|
707 |
|
| 708 |
$c->render( |
708 |
if ( !$biblio_id ) { |
|
|
709 |
|
| 710 |
# FIXME: AddBiblio wraps everything inside a transaction and a try/catch block |
| 711 |
# this will need a tweak if this behavior changes |
| 712 |
return $c->render( |
| 713 |
status => 400, |
| 714 |
openapi => { |
| 715 |
error => 'Error creating record', |
| 716 |
error_code => 'record_creation_failed', |
| 717 |
}, |
| 718 |
); |
| 719 |
} |
| 720 |
|
| 721 |
return $c->render( |
| 709 |
status => 200, |
722 |
status => 200, |
| 710 |
openapi => { id => $biblio_id } |
723 |
openapi => { id => $biblio_id } |
| 711 |
); |
724 |
); |