Skip to content

Commit

Permalink
fix: minor fix related to creating citations
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramkanakam87 committed Oct 2, 2024
1 parent 51510be commit b75caa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Models/Citation.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static function getForm()
->live(onBlur: true)
->afterStateUpdated(function ($set, $state) {
if (doiRegxMatch($state)) {
$set('failMessage', 'Fetching');
$citationDetails = fetchDOICitation($state);
if ($citationDetails) {
$set('title', $citationDetails['title']);
Expand Down Expand Up @@ -103,7 +104,7 @@ public static function getForm()
->unique()
->rules([
fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) {
if ($get('failMessage') != 'No citation found. Please fill in the details manually') {
if ($get('failMessage') != 'Success') {
$fail($get('failMessage'));
}
},
Expand Down

0 comments on commit b75caa4

Please sign in to comment.