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 { useQuery, useQueryClient, useMutation } from "@tanstack/react-query"; | |
| import axios from "axios"; | |
| export const useEntities = <T extends { id: string }>( | |
| key: string, | |
| url: string | |
| ) => { | |
| const entities = useQuery<T[], Error>( | |
| [key], | |
| async ({ signal }): Promise<T[]> => { |
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 Phil Haack | |
| Licensed under the MIT license - https://github.com/haacked/CodeHaacks/blob/main/LICENSE. | |
| */ | |
| using System; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using Microsoft.EntityFrameworkCore; | |
| using Microsoft.EntityFrameworkCore.Metadata.Builders; |
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
| // Use a conditional, because You may not want to provide swagger documentation in public environments | |
| if (_configuration.GetValue<bool>("SwaggerConfiguration:EnableSwagger")) | |
| { | |
| services.AddEndpointsApiExplorer(); | |
| services.AddSwaggerGen(options => { | |
| options.AddCustomIds(); | |
| options.AddMetadata(typeof(Program)); | |
| options.SchemaFilter<NullableEnumSchemaFilter>(); | |
| options.SchemaFilter<RequiredPropertiesSchemaFilter>(); |
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 fs from 'fs'; | |
| import path from 'path'; | |
| import { defineConfig } from 'tsup'; | |
| // INFO: This is the only place you need to update when adding new entry folders | |
| const entryFolders = ['primitives', 'ui']; | |
| function getAllFilesInDirectory(dirPath: string): string[] { | |
| return fs.readdirSync(dirPath).reduce<string[]>((allFiles, file) => { |
OlderNewer