mirror of
https://github.com/D4M13N-D3V/comissions-app-core-api.git
synced 2025-06-16 05:09:09 +00:00
fix: changed how requests are queried.
This commit is contained in:
parent
f076349307
commit
91837e0e05
@ -669,24 +669,8 @@ public class RequestsController : Controller
|
|||||||
{
|
{
|
||||||
var userId = User.GetUserId();
|
var userId = User.GetUserId();
|
||||||
var query = _dbContext.Requests
|
var query = _dbContext.Requests
|
||||||
.Where(x => x.UserId == userId);
|
.Where(x => x.UserId == userId)
|
||||||
|
.Where(x => x.Completed == completed || x.Declined == declined || x.Accepted == accepted || x.Paid == paid);
|
||||||
if (completed)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Completed );
|
|
||||||
}
|
|
||||||
if (declined)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Declined);
|
|
||||||
}
|
|
||||||
if (accepted)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Accepted);
|
|
||||||
}
|
|
||||||
if (paid)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Paid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(search))
|
if (!string.IsNullOrWhiteSpace(search))
|
||||||
{
|
{
|
||||||
@ -710,24 +694,8 @@ public class RequestsController : Controller
|
|||||||
{
|
{
|
||||||
var userId = User.GetUserId();
|
var userId = User.GetUserId();
|
||||||
var query = _dbContext.Requests
|
var query = _dbContext.Requests
|
||||||
.Where(x => x.UserId == userId);
|
.Where(x => x.UserId == userId)
|
||||||
|
.Where(x => x.Completed == completed || x.Declined == declined || x.Accepted == accepted || x.Paid == paid);
|
||||||
if (completed)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Completed );
|
|
||||||
}
|
|
||||||
if (declined)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Declined);
|
|
||||||
}
|
|
||||||
if (accepted)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Accepted);
|
|
||||||
}
|
|
||||||
if (paid)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Paid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(search))
|
if (!string.IsNullOrWhiteSpace(search))
|
||||||
{
|
{
|
||||||
@ -763,24 +731,9 @@ public class RequestsController : Controller
|
|||||||
{
|
{
|
||||||
var userId = User.GetUserId();
|
var userId = User.GetUserId();
|
||||||
var query = _dbContext.Requests.Include(x=>x.Artist)
|
var query = _dbContext.Requests.Include(x=>x.Artist)
|
||||||
.Where(x => x.Artist.UserId == userId);
|
.Where(x => x.Artist.UserId == userId)
|
||||||
|
.Where(x => x.Completed == completed || x.Declined == declined || x.Accepted == accepted || x.Paid == paid);
|
||||||
|
|
||||||
if (completed)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Completed );
|
|
||||||
}
|
|
||||||
if (declined)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Declined);
|
|
||||||
}
|
|
||||||
if (accepted)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Accepted);
|
|
||||||
}
|
|
||||||
if (paid)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Paid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(search))
|
if (!string.IsNullOrWhiteSpace(search))
|
||||||
{
|
{
|
||||||
@ -805,24 +758,8 @@ public class RequestsController : Controller
|
|||||||
{
|
{
|
||||||
var userId = User.GetUserId();
|
var userId = User.GetUserId();
|
||||||
var query = _dbContext.Requests.Include(x=>x.Artist)
|
var query = _dbContext.Requests.Include(x=>x.Artist)
|
||||||
.Where(x => x.Artist.UserId == userId);
|
.Where(x => x.Artist.UserId == userId)
|
||||||
|
.Where(x => x.Completed == completed || x.Declined == declined || x.Accepted == accepted || x.Paid == paid);
|
||||||
if (completed)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Completed );
|
|
||||||
}
|
|
||||||
if (declined)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Declined);
|
|
||||||
}
|
|
||||||
if (accepted)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Accepted);
|
|
||||||
}
|
|
||||||
if (paid)
|
|
||||||
{
|
|
||||||
query = query.Where(x => x.Paid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(search))
|
if (!string.IsNullOrWhiteSpace(search))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user