mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
feat: add data access and feature libraries for return process, including models, schemas, and routes
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export * from './lib/response-args.schema';
|
||||
export * from './lib/entity-cotnainer';
|
||||
export * from './lib/entity-container.schema';
|
||||
export * from './lib/result';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const EntityContainerSchema = z.object({
|
||||
const _EntityContainerSchema = z.object({
|
||||
id: z.number(),
|
||||
uId: z.string().optional(),
|
||||
displayLabel: z.string().optional(),
|
||||
@@ -8,8 +8,8 @@ const EntityContainerSchema = z.object({
|
||||
selected: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export function EntityContainer<T>(data: z.ZodType<T>) {
|
||||
return EntityContainerSchema.extend({
|
||||
export function EntityContainerSchema<T>(data: z.ZodType<T>) {
|
||||
return _EntityContainerSchema.extend({
|
||||
data: data.optional(),
|
||||
});
|
||||
}
|
||||
|
||||
7
libs/common/result/src/lib/entity-cotnainer.ts
Normal file
7
libs/common/result/src/lib/entity-cotnainer.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface EntityContainer<T> {
|
||||
id: number;
|
||||
displayName?: string;
|
||||
data?: T;
|
||||
enabled?: boolean;
|
||||
selected?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user