Fetch only the app slug when resolving an app by name

Affects many env & tags commands, as well
as support, releases & preload.

Change-type: patch
This commit is contained in:
Thodoris Greasidis 2023-05-20 01:04:22 +03:00
parent ba1f17d537
commit ecbc660bf5

View File

@ -76,7 +76,7 @@ export async function getFleetSlug(
if (!looksLikeFleetSlug(nameOrSlug)) { if (!looksLikeFleetSlug(nameOrSlug)) {
// Not a slug: must be an app name. // Not a slug: must be an app name.
// TODO: revisit this logic when we add support for fleet UUIDs. // TODO: revisit this logic when we add support for fleet UUIDs.
return (await getApplication(sdk, nameOrSlug)).slug; return (await getApplication(sdk, nameOrSlug, { $select: 'slug' })).slug;
} }
return nameOrSlug.toLowerCase(); return nameOrSlug.toLowerCase();
} }