fix: returns existing seller profile request instead of 401

This commit is contained in:
Damien Ostler 2024-02-13 21:01:52 -05:00
parent 2f6403d296
commit d9f01cc96c

View File

@ -3,6 +3,7 @@ using comissions.app.api.Models.PortfolioModel;
using ArtPlatform.Database;
using ArtPlatform.Database.Entities;
using comissions.app.api.Models.SellerProfile;
using comissions.app.api.Models.SellerProfileRequest;
using comissions.app.api.Services.Payment;
using comissions.app.api.Services.Storage;
using comissions.app.database;
@ -79,8 +80,8 @@ public class SellerProfileController : Controller
}
var sellerProfileRequest = await _dbContext.SellerProfileRequests.FirstOrDefaultAsync(request=>request.UserId==userId);
if(sellerProfileRequest!=null)
return BadRequest("Account has already requested to be a seller.");
if (sellerProfileRequest != null)
return Ok(sellerProfileRequest.ToModel());
sellerProfileRequest = new SellerProfileRequest()
{