Compare commits

..

No commits in common. "e7481eac95fe25c8f60fafcfd99b6c24b35151da" and "a35b50bec62cd246a724332971a668a8077b3b95" have entirely different histories.

4 changed files with 3 additions and 46 deletions

View File

@ -2,7 +2,6 @@
namespace App\Http\Controllers;
use App\Http\Resources\DynamicResource;
use App\Models\Dynamic;
use App\Models\User;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
@ -45,7 +44,7 @@ class ParticipantController extends Controller
->get();
return Inertia::render('Dynamics/Participants/Show', [
'dynamic' => new DynamicResource($dynamic),
'dynamic' => $dynamic,
'participant' => [
'id' => $user->id,
'name' => $user->name,

View File

@ -13,11 +13,10 @@ return new class extends Migration
{
Schema::create('predefined_mutations', function (Blueprint $table) {
$table->id();
$table->foreignId('dynamic_id')->constrained()->cascadeOnDelete();
$table->foreignId('ledger_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->text('description')->nullable();
$table->integer('amount');
$table->string('type')->default('reward');
$table->timestamps();
});
}

View File

@ -1,41 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('predefined_mutations', function (Blueprint $table) {
// Drop old foreign key constraint first
$table->dropForeign(['dynamic_id']);
// Drop old columns
$table->dropColumn(['dynamic_id', 'type']);
// Add new ledger relationship (nullable to support pre-existing entries gracefully)
$table->foreignId('ledger_id')
->after('id')
->nullable()
->constrained()
->cascadeOnDelete();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('predefined_mutations', function (Blueprint $table) {
$table->dropConstrainedForeignId('ledger_id');
$table->foreignId('dynamic_id')->after('id')->constrained()->cascadeOnDelete();
$table->string('type')->default('reward');
});
}
};

View File

@ -196,7 +196,7 @@ function getAmountClass(amount: number): string {
</button>
</div>
<Chat v-if="mutation.chat" :chat="mutation.chat" :dynamic-id="dynamicId" :participants="participants" />
<Chat :chat="mutation.chat" :dynamic-id="dynamicId" :participants="participants" />
</li>
</ul>
<div v-if="mutations.length === 0" class="c-mutation-list__empty">