feat: connect resource library workflows
This commit is contained in:
@@ -9,7 +9,7 @@ export type ResourcePickerOption = LibraryItemVM & {
|
||||
};
|
||||
|
||||
export type ModelPickerOption = ResourcePickerOption & {
|
||||
poseId: number;
|
||||
poseId?: number | null;
|
||||
};
|
||||
|
||||
type ResourceBinding = {
|
||||
@@ -68,9 +68,19 @@ export function getServiceModeForCustomerLevel(
|
||||
|
||||
export function mapModelOptions(items: LibraryItemVM[]): ModelPickerOption[] {
|
||||
return items.flatMap((item) => {
|
||||
if (typeof item.backendId === "number") {
|
||||
return [
|
||||
{
|
||||
...item,
|
||||
backendId: item.backendId,
|
||||
poseId: item.poseId ?? null,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
const binding = getResourceBinding(item.id);
|
||||
|
||||
if (!binding?.poseId) {
|
||||
if (!binding) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -78,7 +88,7 @@ export function mapModelOptions(items: LibraryItemVM[]): ModelPickerOption[] {
|
||||
{
|
||||
...item,
|
||||
backendId: binding.backendId,
|
||||
poseId: binding.poseId,
|
||||
poseId: binding.poseId ?? null,
|
||||
},
|
||||
];
|
||||
});
|
||||
@@ -88,6 +98,15 @@ export function mapResourceOptions(
|
||||
items: LibraryItemVM[],
|
||||
): ResourcePickerOption[] {
|
||||
return items.flatMap((item) => {
|
||||
if (typeof item.backendId === "number") {
|
||||
return [
|
||||
{
|
||||
...item,
|
||||
backendId: item.backendId,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
const binding = getResourceBinding(item.id);
|
||||
|
||||
if (!binding) {
|
||||
|
||||
Reference in New Issue
Block a user