mirror of
https://github.com/D4M13N-D3V/comissions-app-core-api.git
synced 2025-03-14 10:04:55 +00:00
fix: change the name of parameter
This commit is contained in:
parent
7d84c29127
commit
dd1d5cd6dd
@ -11,6 +11,7 @@ using comissions.app.database.Entities;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace comissions.app.api.Controllers;
|
namespace comissions.app.api.Controllers;
|
||||||
|
|
||||||
@ -153,7 +154,7 @@ public class SellerProfileController : Controller
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("Portfolio")]
|
[Route("Portfolio")]
|
||||||
[Authorize("write:seller-profile")]
|
[Authorize("write:seller-profile")]
|
||||||
public async Task<IActionResult> AddPortfolio([FromForm]IFormFile file)
|
public async Task<IActionResult> AddPortfolio([FromBody]IFormFile newImage)
|
||||||
{
|
{
|
||||||
var userId = User.GetUserId();
|
var userId = User.GetUserId();
|
||||||
var existingSellerProfile = await _dbContext.UserSellerProfiles.FirstOrDefaultAsync(sellerProfile=>sellerProfile.UserId==userId);
|
var existingSellerProfile = await _dbContext.UserSellerProfiles.FirstOrDefaultAsync(sellerProfile=>sellerProfile.UserId==userId);
|
||||||
@ -164,7 +165,7 @@ public class SellerProfileController : Controller
|
|||||||
|
|
||||||
if(existingSellerProfile.Suspended)
|
if(existingSellerProfile.Suspended)
|
||||||
return BadRequest();
|
return BadRequest();
|
||||||
var url = await _storageService.UploadImageAsync(file, Guid.NewGuid().ToString());
|
var url = await _storageService.UploadImageAsync(newImage, Guid.NewGuid().ToString());
|
||||||
var portfolio = new SellerProfilePortfolioPiece()
|
var portfolio = new SellerProfilePortfolioPiece()
|
||||||
{
|
{
|
||||||
SellerProfileId = existingSellerProfile.Id,
|
SellerProfileId = existingSellerProfile.Id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user