This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NextResponse } from 'next/server'; | |
| import { NextRequest } from 'next/server'; | |
| /** | |
| * Product Availability API | |
| * | |
| * Simulates checking inventory/stock from a slow backend system. | |
| * Represents real-world scenarios like checking warehouse inventory, | |
| * fetching real-time pricing, or validating product availability. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Async Server Component | |
| async function DataComponent({ title, text }) { | |
| const response = await fetch('/api/data'); | |
| const data = await response.json(); | |
| return ( | |
| <div> | |
| <h3>{title}</h3> | |
| <p>{data.date}</p> | |
| <div dangerouslySetInnerHTML={{__html: text}} /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net.Http.Headers; | |
| using System.Text; | |
| using System.Text.Json; | |
| using IdentityModel.Client; | |
| var builder = WebApplication.CreateBuilder(args); | |
| // Register necessary services | |
| builder.Services | |
| .AddLogging(logging => logging.AddConsole()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.Mvc; | |
| using Newtonsoft.Json; | |
| using NPoco; | |
| using Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations; | |
| using Umbraco.Cms.Infrastructure.Scoping; | |
| using Umbraco.Cms.Web.Common.Controllers; | |
| namespace UmbracoProject; | |
| public class FeedbackController : UmbracoApiController |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Umbraco.Cms.Core.DeliveryApi; | |
| using Umbraco.Cms.Core.Models.PublishedContent; | |
| using Umbraco.Cms.Core.Routing; | |
| namespace UmbracoProject; | |
| public class CustomApiMediaUrlProvider : IApiMediaUrlProvider | |
| { | |
| private readonly IPublishedUrlProvider _publishedUrlProvider; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import i18n from 'i18next'; | |
| import Helmet from 'react-helmet'; | |
| import TopLoader from 'react-top-loader'; | |
| import { isEditorActive, withSitecoreContext } from '@sitecore-jss/sitecore-jss-react'; | |
| import { layoutServiceFactory } from './lib/layout-service-factory'; | |
| import config from './temp/config'; | |
| import Layout from './Layout'; | |
| import NotFound from './NotFound'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ProjectIdentityProvider : IdentityProvidersProcessor | |
| { | |
| private readonly IConfigurationRepository configurationRepository; | |
| private readonly IUrlUtils urlUtils; | |
| private readonly ICookieManager cookieManager; | |
| public ProjectIdentityProvider( | |
| IConfigurationRepository configurationRepository, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useEffect, useState } from 'react'; | |
| import { withSitecoreContext, dataApi, Placeholder } from '@sitecore-jss/sitecore-jss-react'; | |
| import { dataFetcher } from './dataFetcher'; | |
| import config from './temp/config'; | |
| const HybridPlaceholder = ({ | |
| name, | |
| rendering, | |
| sitecoreContext, | |
| }) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // -------------------------------------------------------------------------------------------------------------------- | |
| // <copyright file="ContentExtensions.cs" company="Colours B.V."> | |
| // © Colours B.V. 2015 | |
| // </copyright> | |
| // <summary> | |
| // The content extensions. | |
| // </summary> | |
| // -------------------------------------------------------------------------------------------------------------------- | |
| namespace Project.Web.Core.Extensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var items = this.GetPropertyValue<IEnumerable<IPublishedContent>>("sliderNestedContent"); | |
| //Slider is a generated model based on a document type. | |
| //Currently x as Slider returns null. | |
| return items.Select(x => x as Slider); |
NewerOlder