mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
api enhancements
This commit is contained in:
@@ -35,7 +35,7 @@ class FavouriteController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove folder from user favourites
|
* Remove folder from user favourites
|
||||||
*/
|
*/
|
||||||
public function destroy(string $id): Response|Collection
|
public function destroy(string $id): Response
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class ShareController extends Controller
|
|||||||
public function store(
|
public function store(
|
||||||
CreateShareRequest $request,
|
CreateShareRequest $request,
|
||||||
SendViaEmailAction $sendLinkToEmailAction,
|
SendViaEmailAction $sendLinkToEmailAction,
|
||||||
): ShareResource {
|
): Response {
|
||||||
$item = get_item($request->input('type'), $request->input('id'));
|
$item = get_item($request->input('type'), $request->input('id'));
|
||||||
|
|
||||||
$this->authorize('owner', $item);
|
$this->authorize('owner', $item);
|
||||||
@@ -52,7 +52,7 @@ class ShareController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return created shared record
|
// Return created shared record
|
||||||
return new ShareResource($shared);
|
return response(new ShareResource($shared), 201);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class CreateShareRequest extends FormRequest
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'id' => 'required|string',
|
||||||
'isPassword' => 'required|boolean',
|
'isPassword' => 'required|boolean',
|
||||||
'type' => 'required|string',
|
'type' => 'required|string',
|
||||||
'expiration' => 'integer|nullable',
|
'expiration' => 'integer|nullable',
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ if (! function_exists('make_single_input')) {
|
|||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
// Add data to array
|
// Add data to array
|
||||||
$data[$request->name] = $request->value;
|
$data[$request->input('name')] = $request->input('value');
|
||||||
|
|
||||||
// Return input
|
// Return input
|
||||||
return $data;
|
return $data;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user