Skip to content

Commit

Permalink
PR feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Feb 14, 2024
1 parent 15cdea6 commit 45246c2
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,19 @@ export const hydrateMonitorFields = async ({
{ preserve_namespace?: boolean }
>;

const inlineSource = (normalizedMonitor as BrowserSensitiveSimpleFields)?.[
ConfigKey.SOURCE_INLINE
] as string | undefined;

return {
...normalizedMonitor,
[ConfigKey.MONITOR_QUERY_ID]: normalizedMonitor[ConfigKey.CUSTOM_HEARTBEAT_ID] || newMonitorId,
[ConfigKey.CONFIG_ID]: newMonitorId,
[ConfigKey.NAMESPACE]: preserveNamespace
? normalizedMonitor[ConfigKey.NAMESPACE]
: getMonitorNamespace(server, request, normalizedMonitor[ConfigKey.NAMESPACE]),
[ConfigKey.SOURCE_PROJECT_CONTENT]: !!(normalizedMonitor as BrowserSensitiveSimpleFields)?.[
ConfigKey.SOURCE_INLINE
]
? await inlineToProjectZip(
(normalizedMonitor as BrowserSensitiveSimpleFields)?.[ConfigKey.SOURCE_INLINE] as string,
newMonitorId,
server.logger
)
[ConfigKey.SOURCE_PROJECT_CONTENT]: !!inlineSource
? await inlineToProjectZip(inlineSource, newMonitorId, server.logger)
: '',
};
};
Expand Down

0 comments on commit 45246c2

Please sign in to comment.