I have problem get schema from .ts type:
Schema:
<code>
export type Homeworking = {
id: String;
prefix: String;
status: Status;
days: Vacation_day;
approvals: Approval;
employee: User;
};
export type Homeworking_day = {
day: Date;
homeworking_id: String;
};
export type User = {
id: String;
name: String;
surname: String;
active: boolean;
email: String;
isAdmin: boolean;
};
export type Vacation = {
id: String;
prefix: String;
status: Status;
days: Vacation_day[];
approvals: Approval;
employee: User;
};
export type Vacation_day = {
day: Date;
homeworking_id: String;
};
export enum Status {
Pending,
Approved,
Rejected,
}
</code>
<code>
export type Homeworking = {
id: String;
prefix: String;
status: Status;
days: Vacation_day;
approvals: Approval;
employee: User;
};
export type Homeworking_day = {
day: Date;
homeworking_id: String;
};
export type User = {
id: String;
name: String;
surname: String;
active: boolean;
email: String;
isAdmin: boolean;
};
export type Vacation = {
id: String;
prefix: String;
status: Status;
days: Vacation_day[];
approvals: Approval;
employee: User;
};
export type Vacation_day = {
day: Date;
homeworking_id: String;
};
export enum Status {
Pending,
Approved,
Rejected,
}
</code>
export type Homeworking = {
id: String;
prefix: String;
status: Status;
days: Vacation_day;
approvals: Approval;
employee: User;
};
export type Homeworking_day = {
day: Date;
homeworking_id: String;
};
export type User = {
id: String;
name: String;
surname: String;
active: boolean;
email: String;
isAdmin: boolean;
};
export type Vacation = {
id: String;
prefix: String;
status: Status;
days: Vacation_day[];
approvals: Approval;
employee: User;
};
export type Vacation_day = {
day: Date;
homeworking_id: String;
};
export enum Status {
Pending,
Approved,
Rejected,
}
AND CODE:
<code>import React, { PropsWithChildren, ReactElement, useContext } from "react";
import { Component, ComponentParams } from "../Component";
import * as Types from "../../../resources/generate/database_types";
import { useData } from "../data";
export type FieldProps = PropsWithChildren & {
component?: string;`your text`
name: string;
params?: { [key: string]: any };
};
export default function Field(props: FieldProps): ReactElement {
const { component = Component.Format, children, name, params } = props;
const { resource } = useContext(ComponentParams);
console.log(Types[resource][name])
</code>
<code>import React, { PropsWithChildren, ReactElement, useContext } from "react";
import { Component, ComponentParams } from "../Component";
import * as Types from "../../../resources/generate/database_types";
import { useData } from "../data";
export type FieldProps = PropsWithChildren & {
component?: string;`your text`
name: string;
params?: { [key: string]: any };
};
export default function Field(props: FieldProps): ReactElement {
const { component = Component.Format, children, name, params } = props;
const { resource } = useContext(ComponentParams);
console.log(Types[resource][name])
</code>
import React, { PropsWithChildren, ReactElement, useContext } from "react";
import { Component, ComponentParams } from "../Component";
import * as Types from "../../../resources/generate/database_types";
import { useData } from "../data";
export type FieldProps = PropsWithChildren & {
component?: string;`your text`
name: string;
params?: { [key: string]: any };
};
export default function Field(props: FieldProps): ReactElement {
const { component = Component.Format, children, name, params } = props;
const { resource } = useContext(ComponentParams);
console.log(Types[resource][name])
Is there any way to get from the schema, for example, that in Homeworking days is Object or ID is String?
So far, I have only tried to retrieve it through console.log, but if I put, for example, only console.log(Types), then there are only enums, not all types, even with enums