brugh
This commit is contained in:
parent
a047f5701b
commit
5f3fbdc0ba
|
|
@ -261,6 +261,10 @@ class CatalogController extends Controller
|
|||
|
||||
if ($sellingItem->seller_id != $user->id) return Response()->json(['message'=>"Thats not you!", 'badInputs'=>['title']]);
|
||||
|
||||
$item = Item::whereId($sellingItem->item_id)->first();
|
||||
|
||||
if (!$sellingItem) return Response()->json(['message'=>"That item doesn't exist!", 'badInputs'=>['title']]);
|
||||
|
||||
$sellingItem->delete();
|
||||
|
||||
if (count($item->sellingPrices) <= 0) {$item->current_price = null;$item->save();}else{$item->current_price = $sellingItemNew->price;$item->save();}
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ class Controller extends BaseController
|
|||
|
||||
foreach ($replies as &$reply) {
|
||||
$creator = User::where('id', $reply['seller_id'])->first();
|
||||
if ($creator->id == $user->id) {$reply['isMeta'] = true;}else{$reply['isMeta'] = false;}
|
||||
$reply['created_at'] = explode('T', $reply['created_at'])[0];
|
||||
$reply['seller_name'] = $creator->username;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ const Item = (props) => {
|
|||
setTimeout(()=>{setValidity({...validity, error: false, inputs: res.badInputs});}, 4000);
|
||||
}else{
|
||||
setPost({item: res.item, sellingPrices: {...item.sellingPrices, sellingPrices: res.sellingPrices.data, meta: res.sellingPrices}});
|
||||
setShow(false);
|
||||
}
|
||||
}).catch(error=>{console.log(error);});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue