a user name hint web api ...
This commit is contained in:
parent
f57f009175
commit
1fc8e499e8
1 changed files with 8 additions and 0 deletions
|
|
@ -32,5 +32,13 @@ namespace Yavsc.ApiControllers.accounting
|
||||||
_dbContext.SaveChanges(User.GetUserId());
|
_dbContext.SaveChanges(User.GetUserId());
|
||||||
return Ok(new { monthlyEmailPrefSaved = allow });
|
return Ok(new { monthlyEmailPrefSaved = allow });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("userhint/{name}")]
|
||||||
|
public UserInfo[] GetUserHint(string name)
|
||||||
|
{
|
||||||
|
return _dbContext.Users.Where(u=>u.UserName.IndexOf(name)>0)
|
||||||
|
.Select(u=>new UserInfo(u.Id, u.UserName, u.Avatar))
|
||||||
|
.Take(10).ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue