Fix bug about wrong type for create kube resource

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2022-12-21 15:04:16 -05:00
1 parent dbae65b488
commit e851a45643
1 file changed
+4 -5
@@ -30,9 +30,8 @@ import navigateInjectable from "../../../navigation/navigate.injectable";
import type { RequestKubeObjectCreation } from "../../../../common/k8s-api/endpoints/resource-applier.api/request-update.injectable"; import type { RequestKubeObjectCreation } from "../../../../common/k8s-api/endpoints/resource-applier.api/request-update.injectable";
import requestKubeObjectCreationInjectable from "../../../../common/k8s-api/endpoints/resource-applier.api/request-update.injectable"; import requestKubeObjectCreationInjectable from "../../../../common/k8s-api/endpoints/resource-applier.api/request-update.injectable";
import loggerInjectable from "../../../../common/logger.injectable"; import loggerInjectable from "../../../../common/logger.injectable";
import type { ShowCheckedErrorNotification } from "../../notifications/show-checked-error.injectable";
import showSuccessNotificationInjectable from "../../notifications/show-success-notification.injectable"; import showSuccessNotificationInjectable from "../../notifications/show-success-notification.injectable";
import showCheckedErrorNotificationInjectable from "../../notifications/show-checked-error.injectable"; import showErrorNotificationInjectable from "../../notifications/show-error-notification.injectable";
export interface CreateResourceProps { export interface CreateResourceProps {
tabId: string; tabId: string;
@@ -47,7 +46,7 @@ interface Dependencies {
getDetailsUrl: GetDetailsUrl; getDetailsUrl: GetDetailsUrl;
requestKubeObjectCreation: RequestKubeObjectCreation; requestKubeObjectCreation: RequestKubeObjectCreation;
showSuccessNotification: ShowNotification; showSuccessNotification: ShowNotification;
showCheckedErrorNotification: ShowCheckedErrorNotification; showErrorNotification: ShowNotification;
} }
@observer @observer
@@ -96,7 +95,7 @@ class NonInjectedCreateResource extends React.Component<CreateResourceProps & De
if (!result.callWasSuccessful) { if (!result.callWasSuccessful) {
this.props.logger.warn("Failed to create resource", { resource }, result.error); this.props.logger.warn("Failed to create resource", { resource }, result.error);
this.props.showCheckedErrorNotification(result.error, "Unknown error occured while creating resources"); this.props.showErrorNotification(result.error);
return; return;
} }
@@ -184,6 +183,6 @@ export const CreateResource = withInjectables<Dependencies, CreateResourceProps>
navigate: di.inject(navigateInjectable), navigate: di.inject(navigateInjectable),
requestKubeObjectCreation: di.inject(requestKubeObjectCreationInjectable), requestKubeObjectCreation: di.inject(requestKubeObjectCreationInjectable),
showSuccessNotification: di.inject(showSuccessNotificationInjectable), showSuccessNotification: di.inject(showSuccessNotificationInjectable),
showCheckedErrorNotification: di.inject(showCheckedErrorNotificationInjectable), showErrorNotification: di.inject(showErrorNotificationInjectable),
}), }),
}); });