예제 #1
0
        public ActionResult <IEnumerable <string> > PostOrganizer(OrganizerPost organizerPost)
        {
            var result = model.PostOrganizer(organizerPost);

            if (result > 0)
            {
                return(Ok());
            }
            else
            {
                return(Conflict());
            }
        }
예제 #2
0
        public ActionResult <IEnumerable <string> > PutOrganizer(long id, OrganizerPost organizerPost)
        {
            //TODO OrganizerPost überprüfen
            if (!auth.CheckIfOrganizerPermissions(organizerPost, id))
            {
                return(Unauthorized());
            }

            var result = model.PutOrganizer(id, organizerPost);

            if (result)
            {
                //var path = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host.Value}/veranstalter/{result}";
                return(NoContent());
            }
            else
            {
                return(NotFound());
            }
        }