mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
Fix row editor not showing values
This commit is contained in:
1 parent
4de63f52a2
commit
cc966ac86c
1 file changed
+4
-2
+4
-2
@@ -12,6 +12,7 @@ export const generateRowFields = (
|
||||
table: PostgresTable,
|
||||
isNewRecord?: boolean
|
||||
): RowField[] => {
|
||||
console.log('generateRowFields', row)
|
||||
const { relationships, primary_keys } = table
|
||||
// @ts-ignore
|
||||
const primaryKeyColumns = primary_keys.map((key) => key.name)
|
||||
@@ -24,7 +25,7 @@ export const generateRowFields = (
|
||||
? nowDateTimeValue(column.format)
|
||||
: DATETIME_TYPES.includes(column.format)
|
||||
? convertPostgresDatetimeToInputDatetime(column.format, row[column.name])
|
||||
: parseValue(row[column.name], column.format, column.data_type)
|
||||
: parseValue(row[column.name], column.format)
|
||||
|
||||
const foreignKey = find(relationships, (relationship) => {
|
||||
return (
|
||||
@@ -92,7 +93,7 @@ export const generateRowFieldsWithoutColumnMeta = (row: any): RowField[] => {
|
||||
})
|
||||
}
|
||||
|
||||
const parseValue = (originalValue: string, format: string, dataType: string) => {
|
||||
const parseValue = (originalValue: string, format: string) => {
|
||||
try {
|
||||
if (originalValue === null || originalValue.length === 0) {
|
||||
return originalValue
|
||||
@@ -103,6 +104,7 @@ const parseValue = (originalValue: string, format: string, dataType: string) =>
|
||||
} else if (typeof originalValue === 'boolean') {
|
||||
return (originalValue as any).toString()
|
||||
}
|
||||
return originalValue
|
||||
} catch (error) {
|
||||
return originalValue
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user