public async Task <ActionResult <List <ItemTemplateResponse> > > GetSearchItemTemplateAsync(
            [FromServices] OptionalNaheulbookExecutionContext executionContext,
            [FromQuery] string filter
            )
        {
            var itemTemplates = await _itemTemplateService.SearchItemTemplateAsync(filter, 40, executionContext.ExecutionExecutionContext?.UserId);

            return(_mapper.Map <List <ItemTemplateResponse> >(itemTemplates));
        }
Beispiel #2
0
        public async Task <ActionResult <List <ItemTemplateResponse> > > GetItemTemplatesAsync(
            [FromServices] OptionalNaheulbookExecutionContext executionContext,
            int sectionId
            )
        {
            var sections = await _itemTemplateSectionService.GetItemTemplatesBySectionAsync(sectionId, executionContext.ExecutionExecutionContext?.UserId);

            return(_mapper.Map <List <ItemTemplateResponse> >(sections));
        }
Beispiel #3
0
        public async Task <ActionResult <MapResponse> > GetMapAsync(
            [FromServices] OptionalNaheulbookExecutionContext executionContext,
            [FromRoute] int mapId
            )
        {
            try
            {
                var map = await _mapService.GetMapAsync(mapId, executionContext.ExecutionExecutionContext?.UserId);

                return(_mapper.Map <MapResponse>(map));
            }
            catch (MapNotFoundException ex)
            {
                throw new HttpErrorException(StatusCodes.Status404NotFound, ex);
            }
        }
        public async Task <ActionResult <List <ItemTemplateResponse> > > GetItemTemplatesBySubCategoryTechNameAsync(
            [FromServices] OptionalNaheulbookExecutionContext executionContext,
            [FromRoute] string itemTemplateSubCategoryName,
            [FromQuery] bool includeCommunityItems = true
            )
        {
            try
            {
                var itemTemplates = await _itemTemplateSubSubCategoryService.GetItemTemplatesBySubCategoryTechNameAsync(
                    itemTemplateSubCategoryName,
                    executionContext.ExecutionExecutionContext?.UserId,
                    includeCommunityItems
                    );

                return(_mapper.Map <List <ItemTemplateResponse> >(itemTemplates));
            }
            catch (ItemTemplateSubCategoryNotFoundException ex)
            {
                throw new HttpErrorException(StatusCodes.Status404NotFound, ex);
            }
        }