Skip to content

Commit

Permalink
Implement annotation-store rules directly in StoreImageAnnotation
Browse files Browse the repository at this point in the history
  • Loading branch information
gkourie committed Dec 20, 2024
1 parent ae7d882 commit 296d0f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 54 deletions.
10 changes: 7 additions & 3 deletions app/Http/Requests/StoreImageAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Biigle\Image;
use Biigle\Shape;
use Illuminate\Foundation\Http\FormRequest;

class StoreImageAnnotation extends StoreImageAnnotationLabelFeatureVector
class StoreImageAnnotation extends FormRequest
{
/**
* The image on which the annotation should be created.
Expand Down Expand Up @@ -33,10 +34,13 @@ public function authorize()
*/
public function rules()
{
return array_merge(parent::rules(), [
return [
'label_id' => 'required_without:feature_vector|integer|exists:labels,id',
'feature_vector' => 'required_without:label_id|array|size:384',
'confidence' => 'required|numeric|between:0,1',
'shape_id' => 'required|integer|exists:shapes,id',
'points' => 'required|array',
]);
];
}

/**
Expand Down
51 changes: 0 additions & 51 deletions app/Http/Requests/StoreImageAnnotationLabelFeatureVector.php

This file was deleted.

0 comments on commit 296d0f9

Please sign in to comment.