@goweekdays/layer-common 1.5.11 → 1.5.12

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @goweekdays/layer-common
2
2
 
3
+ ## 1.5.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 7573c5e: Refactor and extend job applications composable
8
+
3
9
  ## 1.5.11
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,65 @@
1
+ export function useJobApplication() {
2
+ const jobApplication = ref<TJobApplication>({
3
+ post: "",
4
+ jobTitle: "",
5
+ company: "",
6
+ companyName: "",
7
+ location: "",
8
+ user: "",
9
+ name: "",
10
+ email: "",
11
+ contact: "",
12
+ metadata: {
13
+ resume: "",
14
+ resumeUrl: "",
15
+ portfolio: "",
16
+ portfolioUrl: "",
17
+ coverLetter: "",
18
+ coverLetterUrl: "",
19
+ },
20
+ status: "",
21
+ });
22
+
23
+ function add(value: TJobApplication) {
24
+ return useNuxtApp().$api<TJobApplication>(`/api/job/applications`, {
25
+ method: "POST",
26
+ body: value,
27
+ });
28
+ }
29
+
30
+ function getAll({ page = 1, limit = 50, status = "new", search = "" } = {}) {
31
+ return useNuxtApp().$api<Record<string, any>>(`/api/job/applications`, {
32
+ method: "GET",
33
+ query: {
34
+ page,
35
+ limit,
36
+ status,
37
+ search,
38
+ },
39
+ });
40
+ }
41
+
42
+ function getById(id: string) {
43
+ return useNuxtApp().$api<TJobApplication>(
44
+ `/api/job/applications/id/${id}`,
45
+ {
46
+ method: "GET",
47
+ }
48
+ );
49
+ }
50
+
51
+ function updateStatusById(id: string, status: string) {
52
+ return useNuxtApp().$api<string>(`/api/job/applications/id/${id}/status`, {
53
+ method: "PATCH",
54
+ body: { status },
55
+ });
56
+ }
57
+
58
+ return {
59
+ jobApplication,
60
+ add,
61
+ getAll,
62
+ getById,
63
+ updateStatusById,
64
+ };
65
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@goweekdays/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.5.11",
5
+ "version": "1.5.12",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -0,0 +1,26 @@
1
+ declare type TJobApplicationMetadata = {
2
+ resume?: string;
3
+ resumeUrl?: string;
4
+ portfolio?: string;
5
+ portfolioUrl?: string;
6
+ coverLetter?: string;
7
+ coverLetterUrl?: string;
8
+ };
9
+
10
+ declare type TJobApplication = {
11
+ _id?: string;
12
+ post: string;
13
+ jobTitle?: string;
14
+ company?: string;
15
+ companyName?: string;
16
+ location?: string;
17
+ user: string;
18
+ name: string;
19
+ email: string;
20
+ contact?: string;
21
+ metadata?: TJobApplicationMetadata;
22
+ status?: string;
23
+ createdAt?: Date | String;
24
+ updatedAt?: Date | String;
25
+ deletedAt?: Date | String;
26
+ };