Closed
Description
When I try to create a record with array property inside it ingores provided array values and saves a record without them.
P.S. edit works fine, so the issue is only with creation
Installed libraries and their versions
- adminjs@5.2.1
- @adminjs/express@4.0.0
- @adminjs/nestjs@3.0.0
- @adminjs/typeorm@2.0.0
PostgreSQL:13.3
To Reproduce
Steps to reproduce the behavior:
- Click on 'Create new' on resource with array field inside
- Fill array field with values
- Bug: It will create record without those provided array values
Expected behavior
It should save array values on creation of a new record
Screenshots
If applicable, add screenshots to help explain your problem.
AdminJSOptions with schema
Paste your AdminJS config with database schema if it could be related to the issue
AdminJS resource config
CompanyResource = {
resource: Company,
options: {
navigation: {
name: null,
},
properties: {
id: {
name: 'string',
isVisible: false,
},
name: {
type: 'string',
},
email: {
type: 'string',
},
phoneNumbers: {
isArray: true,
type: 'string',
isVisible: { list: false, filter: false, show: true, edit: true },
},
},
},
};
database schema:
-- auto-generated definition
create table companies
(
id uuid default gen_random_uuid() not null
constraint "PK_d4bc3e82a314fa9e29f652c2c22"
primary key,
name varchar not null,
email varchar not null,
socials jsonb,
phone_numbers text[] not null,
comments text
);
alter table companies
owner to postgres;
Additional context
Before I added default value as empty array array[]::text[]
to phone_numbers it was throwing me null violation exception from postgres.
Metadata
Metadata
Assignees
Labels
No labels