@@ -108,22 +108,18 @@ Now you can inject `ICacheTagService` in any constructor in your project - wohoo
108108
109109Now that we have our service it's time to create an endpoint where we can fetch the (cached) tags.
110110
111- {% hint style="warning" %}
112- The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15.
113- {% endhint %}
114-
115111``` csharp
116112using System ;
117113using System .Collections .Generic ;
118114using Microsoft .AspNetCore .Mvc ;
119115using Doccers .Core .Services ;
120116using Umbraco .Cms .Core .Models ;
121- using Umbraco .Cms .Web .Common .Controllers ;
122-
123117
124118namespace Doccers .Core .Controllers .Api ;
125119
126- public class TagsController : UmbracoApiController
120+ [ApiController ]
121+ [Route (" /umbraco/api/tags" )]
122+ public class TagsController : Controller
127123{
128124 private readonly ICacheTagService _tagService ;
129125
@@ -133,7 +129,7 @@ public class TagsController : UmbracoApiController
133129 _tagService = tagService ;
134130 }
135131
136- [HttpGet ]
132+ [HttpGet ( " getdefaulttags " ) ]
137133 public IEnumerable <TagModel > GetDefaultTags ()
138134 {
139135 // As mentioned earlier we want tags from "default"
@@ -142,7 +138,7 @@ public class TagsController : UmbracoApiController
142138 TimeSpan .FromMinutes (1 ));
143139 }
144140
145- [HttpGet ]
141+ [HttpGet ( " getblogtags " ) ]
146142 public IEnumerable <TagModel > GetBlogTags ()
147143 {
148144 // If you don't specify a TimeSpan the object(s)
0 commit comments