Updates
This commit is contained in:
1 parent
d27811254d
commit
582d0e635d
35 files changed
+2944
-1203
No files matched your search
@@ -221,6 +221,25 @@ export function deleteAsset(assetId, userId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Reverse of listAssetLinks: every asset linked to a target (e.g. a PSADT
|
||||
// profile) that the user can see, with the per-link package path/role used by
|
||||
// the package builder to place it in the deployment tree.
|
||||
export function listLinkedAssets(targetType, targetId, userId) {
|
||||
return db.prepare(`
|
||||
SELECT a.*, l.link_role AS link_role, l.package_path AS link_package_path
|
||||
FROM asset_links l
|
||||
INNER JOIN assets a ON a.id = l.asset_id
|
||||
WHERE l.target_type = ? AND l.target_id = ? AND ${visibleClause('a')}
|
||||
ORDER BY l.created_at
|
||||
`).all(targetType, targetId, userId, userId).map((row) => ({
|
||||
assetId: row.id,
|
||||
originalName: row.original_name,
|
||||
kind: row.kind,
|
||||
linkRole: row.link_role,
|
||||
packagePath: row.link_package_path || row.package_path || row.original_name
|
||||
}));
|
||||
}
|
||||
|
||||
export function listAssetLinks(assetId, userId) {
|
||||
const asset = selectAssetById(assetId, userId);
|
||||
if (!asset) return null;
|
||||
|
||||
Reference in new issue
Block a user