Skip to content
Snippets Groups Projects
Unverified Commit 0b0edf1b authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

[MLv2] Expose field_id mlv2 function (#33021)


* expose field_id mlv2 function

* Update frontend/src/metabase-lib/fields.ts

Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>

---------

Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
parent 50da9046
No related branches found
No related tags found
No related merge requests found
......@@ -19,3 +19,14 @@ export function fieldableColumns(
): ColumnMetadata[] {
return ML.fieldable_columns(query, stageIndex);
}
/**
* This should only be used to get field IDs when it is necessary, like interacting with backend API parameters.
* For most purposes, you should be use columnMetadata objects and not access field ids directly
*
* @param {ColumnMetadata} column
* @returns {number|null} field id
*/
export function _fieldId(column: ColumnMetadata): number | null {
return ML.field_id(column);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment