Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Feb 25, 2024
1 parent 25a721b commit fcc7b45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/Http/Controllers/Users/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Models\Character\Character;
use App\Models\Currency\Currency;
use App\Models\Gallery\GallerySubmission;
use App\Models\Gallery\GallerySubmissionCollaborator;
use App\Models\Item\Item;
use App\Models\Item\ItemCategory;
use App\Models\Prompt\Prompt;
Expand Down Expand Up @@ -88,7 +89,10 @@ public function getNewSubmission(Request $request) {
$inventory = UserItem::with('item')->whereNull('deleted_at')->where('count', '>', '0')->where('user_id', Auth::user()->id)->get();

if (config('lorekeeper.settings.allow_gallery_submissions_on_prompts')) {
$gallerySubmissions = GallerySubmission::where('user_id', Auth::user()->id)->where('status', 'Accepted')->orderBy('id', 'DESC')->get()->pluck('title', 'id');
$collaboratorIds = GallerySubmissionCollaborator::where('user_id', Auth::user()->id)->where('has_approved', 1)->pluck('gallery_submission_id')->toArray();

$gallerySubmissions = GallerySubmission::where('user_id', Auth::user()->id)->orWhereIn('id', $collaboratorIds)->orderBy('id', 'DESC')->get()->pluck('title', 'id');

$gallerySubmissions = $gallerySubmissions->map(function ($item, $key) {
return '"'.$item.'" by '.Auth::user()->name;
});
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Submission/Submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Submission extends Model {
* @var array
*/
public static $createRules = [
'url' => 'nullable',
'url' => 'nullable|url',
];

/**
Expand All @@ -48,7 +48,7 @@ class Submission extends Model {
* @var array
*/
public static $updateRules = [
'url' => 'nullable',
'url' => 'nullable|url',
];

/**********************************************************************************************
Expand Down

0 comments on commit fcc7b45

Please sign in to comment.