add user to list by id

This commit is contained in:
localhost_frssoft 2023-11-16 01:56:58 +03:00
parent baf388cb42
commit 215930e3b9
2 changed files with 11 additions and 0 deletions

View File

@ -770,6 +770,9 @@ func NewHandler(s *service, verbose bool, staticDir string) http.Handler {
id, _ := mux.Vars(c.r)["id"] id, _ := mux.Vars(c.r)["id"]
q := c.r.URL.Query() q := c.r.URL.Query()
uid := q.Get("uid") uid := q.Get("uid")
if uid == "" {
uid = c.r.FormValue("uid")
}
err := s.ListAddUser(c, id, uid) err := s.ListAddUser(c, id, uid)
if err != nil { if err != nil {
return err return err

View File

@ -37,6 +37,14 @@
</span> </span>
<button type="submit"> Search </button> <button type="submit"> Search </button>
</form> </form>
<div class="page-title"> Add user by their ID </div>
<span>some times it can works, some times not</span>
<form class="user-list-action" action="/list/{{$.Data.List.ID}}/adduser?" method="POST">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
<input name="uid">
<button type="submit"> Add </button>
</form>
{{if .Q}} {{if .Q}}
{{if .SearchAccounts}} {{if .SearchAccounts}}