diff --git a/app/Http/Resources/V1/IndependentActivityResource.php b/app/Http/Resources/V1/IndependentActivityResource.php index 616a0cceb..afb2aa9bd 100644 --- a/app/Http/Resources/V1/IndependentActivityResource.php +++ b/app/Http/Resources/V1/IndependentActivityResource.php @@ -18,7 +18,8 @@ public function toArray($request) $data = [ 'id' => $this->id, 'title' => $this->title, - 'type' => $this->h5p_content->library->title, + 'type' => $this->type, + 'library_item_title' => $this->h5p_content->library->title, 'content' => $this->content, 'description' => $this->description, 'shared' => $this->shared, diff --git a/database/migrations/2023_03_09_134145_change_type_from_activities.php b/database/migrations/2023_03_09_134145_change_type_from_activities.php new file mode 100644 index 000000000..8c4c9cfc2 --- /dev/null +++ b/database/migrations/2023_03_09_134145_change_type_from_activities.php @@ -0,0 +1,34 @@ + ChangeTypeFromActivities::class, + '--force' => true + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('activities', function (Blueprint $table) { + // + }); + } +}; diff --git a/database/seeders/ChangeTypeFromActivities.php b/database/seeders/ChangeTypeFromActivities.php new file mode 100644 index 000000000..0376c9c21 --- /dev/null +++ b/database/seeders/ChangeTypeFromActivities.php @@ -0,0 +1,19 @@ +whereNotIn('type', ["h5p_standalone", "h5p"])->update(['type' => "h5p"]); + } +}