@recruitnepal/shared-packages 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"useEasyApplyFormHook.d.ts","sourceRoot":"","sources":["../../src/hooks/useEasyApplyFormHook.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;WAAiC,CAAC;AAErE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsB9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC7E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AA+B/E,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,0HAA0H;IAC1H,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,qDAMlC,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAqDV,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqErC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"useEasyApplyFormHook.d.ts","sourceRoot":"","sources":["../../src/hooks/useEasyApplyFormHook.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;WAAiC,CAAC;AAErE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsB9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC7E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AA+B/E,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,0HAA0H;IAC1H,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,qDAMlC,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAqDV,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoErC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -131,9 +131,8 @@ export const useEasyApplyFormHook = ({ vacancyId, isIntern = false, token, onSuc
131
131
  if (isIntern) {
132
132
  formData.append('is_intern', 'true');
133
133
  }
134
- values.screening_answers.forEach((ans, index) => {
135
- formData.append(`applicant_answers[${index}]`, JSON.stringify(ans));
136
- });
134
+ // Send applicant_answers as a single JSON string so backend receives one field to parse as array of objects (avoids "expected object, received string" when sending applicant_answers[0], applicant_answers[1] as strings)
135
+ formData.append('applicant_answers', JSON.stringify(values.screening_answers));
137
136
  const personalDetailData = await createEasyApply.mutateAsync(formData);
138
137
  if (personalDetailData?.jobId) {
139
138
  if (typeof sessionStorage !== 'undefined') {
package/package.json CHANGED
@@ -1,37 +1,45 @@
1
- {
2
- "name": "@recruitnepal/shared-packages",
3
- "version": "1.2.0",
4
- "description": "Shared UI components and hooks for Recruit Nepal projects",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc",
9
- "dev": "tsc --watch",
10
- "prepublishOnly": "npm run build"
11
- },
12
- "keywords": ["react", "nextjs", "recruit-nepal", "shared-components"],
13
- "author": "",
14
- "license": "MIT",
15
- "peerDependencies": {
16
- "react": "^18.2.0",
17
- "react-dom": "^18.2.0",
18
- "next": "^14.0.0",
19
- "@tanstack/react-query": "^5.50.0",
20
- "zod": "^3.22.0",
21
- "react-hook-form": "^7.49.0",
22
- "@hookform/resolvers": "^3.3.0"
23
- },
24
- "dependencies": {
25
- "axios": "^1.7.8"
26
- },
27
- "devDependencies": {
28
- "@types/node": "^20.11.17",
29
- "@types/react": "^18.2.55",
30
- "@types/react-dom": "^18.2.19",
31
- "typescript": "^5.3.3",
32
- "zod": "^3.22.0",
33
- "react-hook-form": "^7.49.0",
34
- "@hookform/resolvers": "^3.3.0"
35
- },
36
- "files": ["dist", "README.md"]
37
- }
1
+ {
2
+ "name": "@recruitnepal/shared-packages",
3
+ "version": "1.3.0",
4
+ "description": "Shared UI components and hooks for Recruit Nepal projects",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "dev": "tsc --watch",
10
+ "prepublishOnly": "npm run build"
11
+ },
12
+ "keywords": [
13
+ "react",
14
+ "nextjs",
15
+ "recruit-nepal",
16
+ "shared-components"
17
+ ],
18
+ "author": "",
19
+ "license": "MIT",
20
+ "peerDependencies": {
21
+ "react": "^18.2.0",
22
+ "react-dom": "^18.2.0",
23
+ "next": "^14.0.0",
24
+ "@tanstack/react-query": "^5.50.0",
25
+ "zod": "^3.22.0",
26
+ "react-hook-form": "^7.49.0",
27
+ "@hookform/resolvers": "^3.3.0"
28
+ },
29
+ "dependencies": {
30
+ "axios": "^1.7.8"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^20.11.17",
34
+ "@types/react": "^18.2.55",
35
+ "@types/react-dom": "^18.2.19",
36
+ "typescript": "^5.3.3",
37
+ "zod": "^3.22.0",
38
+ "react-hook-form": "^7.49.0",
39
+ "@hookform/resolvers": "^3.3.0"
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "README.md"
44
+ ]
45
+ }