Working proposal apply code, fixed schema (need reset - artisan migrate:fresh)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Proposal;
|
||||
use App\Models\Table;
|
||||
use App\Models\User;
|
||||
use App\Tables\Changeset;
|
||||
@@ -351,6 +352,17 @@ class TableEditController extends Controller
|
||||
return back();
|
||||
}
|
||||
|
||||
//
|
||||
$proposal = Proposal::fromChangeset($changeset);
|
||||
$proposal->saveOrFail();
|
||||
|
||||
if (\user()->ownsTable($tableModel)) {
|
||||
$proposal->createRevision();
|
||||
} else {
|
||||
// TODO send a notification to the table owner
|
||||
}
|
||||
|
||||
session()->forget($tableModel->draftSessionKey);
|
||||
|
||||
return redirect($tableModel->viewRoute);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user