Skip to content

Commit

Permalink
Merge pull request #929 from biigle/patch-1
Browse files Browse the repository at this point in the history
Fix controller to update volume metadata
  • Loading branch information
mzur authored Sep 24, 2024
2 parents 9449164 + 54918b5 commit db17160
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Volumes/MetadataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function store(StoreVolumeMetadata $request)
// is not guaranteed that the file is overwritten.
$request->volume->deleteMetadata();
$request->volume->saveMetadata($request->file('file'));
$request->volume->update(['metadata_parser' => $request->input('metadata_parser')]);
$request->volume->update(['metadata_parser' => $request->input('parser')]);
Queue::push(new UpdateVolumeMetadata($request->volume));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public function testStoreImageMetadata()
])
->assertStatus(200);

$this->assertSame(ImageCsvParser::class, $this->volume()->fresh()->metadata_parser);

Queue::assertPushed(UpdateVolumeMetadata::class, function ($job) {
$this->assertEquals($this->volume()->id, $job->volume->id);

Expand Down Expand Up @@ -130,6 +132,8 @@ public function testStoreVideoMetadataCsv()
])
->assertSuccessful();

$this->assertSame(VideoCsvParser::class, $this->volume()->fresh()->metadata_parser);

Queue::assertPushed(UpdateVolumeMetadata::class, function ($job) {
$this->assertEquals($this->volume()->id, $job->volume->id);

Expand Down

0 comments on commit db17160

Please sign in to comment.