@nuxt-customer-portal/service-requests 0.8.9 → 0.9.1

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,21 @@
1
1
  # @nuxt-customer-portal/service-requests
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @nuxt-customer-portal/clients@0.9.1
8
+ - @nuxt-customer-portal/core@0.9.1
9
+
10
+ ## 0.9.0
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [936f0a2]
15
+ - Updated dependencies [6696fd0]
16
+ - @nuxt-customer-portal/core@0.9.0
17
+ - @nuxt-customer-portal/clients@0.9.0
18
+
3
19
  ## 0.8.9
4
20
 
5
21
  ### Patch Changes
@@ -21,7 +21,9 @@ export const useAdminServiceRequests = () => {
21
21
  loading.value = true
22
22
  error.value = null
23
23
  try {
24
- const response = await $fetch<ServiceRequestListResponse>('/api/service-requests/admin', { query: filters })
24
+ const response = await $fetch<ServiceRequestListResponse, string>('/api/service-requests/admin', {
25
+ query: filters
26
+ })
25
27
  requests.value = response.items
26
28
  pagination.value = response.pagination
27
29
  } catch (cause) {
@@ -33,7 +35,7 @@ export const useAdminServiceRequests = () => {
33
35
  }
34
36
 
35
37
  const adminUpdateRequest = async (id: string, data: AdminServiceRequestUpdateInput) => {
36
- const updated = await $fetch<ServiceRequest>(`/api/service-requests/admin/${id}`, {
38
+ const updated = await $fetch<ServiceRequest, string>(`/api/service-requests/admin/${id}`, {
37
39
  method: 'PATCH',
38
40
  body: data
39
41
  })
@@ -46,7 +48,9 @@ export const useAdminServiceRequests = () => {
46
48
 
47
49
  return {
48
50
  getAssignees: () =>
49
- $fetch<Array<{ id: string; name: string; image: string | null }>>('/api/service-requests/admin/assignees'),
51
+ $fetch<Array<{ id: string; name: string; image: string | null }>, string>(
52
+ '/api/service-requests/admin/assignees'
53
+ ),
50
54
  requests: readonly(requests),
51
55
  loading: readonly(loading),
52
56
  error: readonly(error),
@@ -10,7 +10,7 @@ export const usePaginatedServiceRequests = (pageSize = 20) =>
10
10
  pageSize,
11
11
  getKey: (request) => request.id,
12
12
  fetchPage: ({ filters, page, pageSize, signal }) =>
13
- $fetch<ServiceRequestListResponse>('/api/service-requests', {
13
+ $fetch<ServiceRequestListResponse, string>('/api/service-requests', {
14
14
  query: {
15
15
  ...filters,
16
16
  page,
@@ -34,7 +34,7 @@ export const useServiceRequestList = (options: {
34
34
  pageSize,
35
35
  getKey: (item) => (item as { id: string }).id,
36
36
  fetchPage: async ({ filters: query, page, pageSize, signal }) => {
37
- const result = await $fetch<ServiceRequestListResponse>(options.endpoint, {
37
+ const result = await $fetch<ServiceRequestListResponse, string>(options.endpoint, {
38
38
  query: { ...query, page, pageSize },
39
39
  signal
40
40
  })
@@ -19,7 +19,7 @@ export const useServiceRequests = () => {
19
19
  loading.value = true
20
20
  error.value = null
21
21
  try {
22
- const response = await $fetch<ServiceRequestListResponse>('/api/service-requests', { query: filters })
22
+ const response = await $fetch<ServiceRequestListResponse, string>('/api/service-requests', { query: filters })
23
23
  requests.value = response.items
24
24
  pagination.value = response.pagination
25
25
  return response
@@ -34,7 +34,7 @@ export const useServiceRequests = () => {
34
34
  const createRequest = async (data: ServiceRequestCreateInput) => {
35
35
  loading.value = true
36
36
  try {
37
- const created = await $fetch<ServiceRequest>('/api/service-requests', { method: 'POST', body: data })
37
+ const created = await $fetch<ServiceRequest, string>('/api/service-requests', { method: 'POST', body: data })
38
38
  requests.value.unshift(created)
39
39
  return created
40
40
  } finally {
@@ -45,7 +45,10 @@ export const useServiceRequests = () => {
45
45
  const updateRequest = async (id: string, data: ServiceRequestUpdateInput) => {
46
46
  loading.value = true
47
47
  try {
48
- const updated = await $fetch<ServiceRequest>(`/api/service-requests/${id}`, { method: 'PATCH', body: data })
48
+ const updated = await $fetch<ServiceRequest, string>(`/api/service-requests/${id}`, {
49
+ method: 'PATCH',
50
+ body: data
51
+ })
49
52
  const index = requests.value.findIndex((request) => request.id === id)
50
53
  if (index >= 0) {
51
54
  requests.value[index] = updated
@@ -57,11 +60,11 @@ export const useServiceRequests = () => {
57
60
  }
58
61
 
59
62
  const deleteRequest = async (id: string) => {
60
- await $fetch(`/api/service-requests/${id}`, { method: 'DELETE' as never })
63
+ await $fetch<unknown, string>(`/api/service-requests/${id}`, { method: 'DELETE' as never })
61
64
  requests.value = requests.value.filter((request) => request.id !== id)
62
65
  }
63
66
 
64
- const getRequest = (id: string) => $fetch<ServiceRequest>(`/api/service-requests/${id}`)
67
+ const getRequest = (id: string) => $fetch<ServiceRequest, string>(`/api/service-requests/${id}`)
65
68
  const getStatusBadgeText = (status: ServiceRequestStatus) =>
66
69
  t(`features.serviceRequests.status.${status.toLowerCase()}`)
67
70
  const getPriorityBadgeText = (priority: ServiceRequestPriority) =>
@@ -4,7 +4,7 @@ export const useServiceRequestsDashboard = () => {
4
4
  const { activeOrganizationId } = usePortalSession()
5
5
  return useAsyncData(
6
6
  'service-requests-dashboard',
7
- () => $fetch<ServiceRequestDashboardDto>('/api/service-requests/dashboard'),
7
+ () => $fetch<ServiceRequestDashboardDto, string>('/api/service-requests/dashboard'),
8
8
  {
9
9
  watch: [activeOrganizationId],
10
10
  dedupe: 'defer'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt-customer-portal/service-requests",
3
- "version": "0.8.9",
3
+ "version": "0.9.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://nuxt-customer-portal.com",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "nanoid": "^5.1.6",
42
42
  "pg": "^8.22.0",
43
43
  "zod": "^4.4.3",
44
- "@nuxt-customer-portal/core": "^0.8.9",
45
- "@nuxt-customer-portal/clients": "^0.8.9"
44
+ "@nuxt-customer-portal/clients": "^0.9.1",
45
+ "@nuxt-customer-portal/core": "^0.9.1"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "nuxt": "^4.5.1"
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  id: 'service-requests',
3
- version: '0.8.9',
3
+ version: '0.9.1',
4
4
  source: '@nuxt-customer-portal/service-requests',
5
5
  clientModuleId: 'service-requests',
6
6
  dependsOn: ['core', 'clients'],