Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

Add pending inputs as a new Keyword

CorreyLac322a9bd49c
diff --git a/apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx b/apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx
index 6022afd20..7ad3f11ee 100644
--- a/apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx
+++ b/apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx
@@ -31,6 +31,7 @@ type Props<T extends SectionItem> = {
id: DialogName;
form: UseFormReturn<T>;
defaultValues: T;
+ pendingKeyword?: string;
children: React.ReactNode;
};
@@ -38,6 +39,7 @@ export const SectionDialog = <T extends SectionItem>({
id,
form,
defaultValues,
+ pendingKeyword,
children,
}: Props<T>) => {
const { isOpen, mode, close, payload } = useDialog<T>(id);
@@ -61,6 +63,9 @@ export const SectionDialog = <T extends SectionItem>({
if (!section) return;
if (isCreate || isDuplicate) {
+ if (pendingKeyword && values.keywords) {
+ values.keywords.push(pendingKeyword);
+ }
setValue(
`sections.${id}.items`,
produce(section.items, (draft: T[]): void => {
@@ -72,6 +77,10 @@ export const SectionDialog = <T extends SectionItem>({
if (isUpdate) {
if (!payload.item?.id) return;
+ if (pendingKeyword && values.keywords) {
+ values.keywords.push(pendingKeyword);
+ }
+
setValue(
`sections.${id}.items`,
produce(section.items, (draft: T[]): void => {