Hello there! I'm using adminJS together with sequelize, and I have to say, thanks for saving me from tedious admin code! :heart:
I have a country table with a countryCode PK that I'm not able to fill in using adminjs.
I understand it shouldn't be editable (it's a primary key after all) but I noticed that creating a new country resulted in a SQL query that didn't have a countryCode.
Hello there! I'm using adminJS together with sequelize, and I have to say, thanks for saving me from tedious admin code! :heart:
I have a
country
table with acountryCode
PK that I'm not able to fill in using adminjs.I understand it shouldn't be editable (it's a primary key after all) but I noticed that creating a new
country
resulted in a SQL query that didn't have acountryCode
.Here are the relevant bits of my Country model:
After some digging, I noticed that in
property.ts
there is aisEditable
function that returns false if the field is a primary key.I fixed the issue using patch-package, by making
isEditable
not checkisId
during creation. The patch is below: