@consilioweb/payload-support 1.1.0 → 1.1.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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/collections/Tickets.ts +4 -1
package/dist/index.cjs
CHANGED
|
@@ -7294,7 +7294,7 @@ function createRestrictClientUpdates(slugs) {
|
|
|
7294
7294
|
return async ({ data, operation, req, originalDoc }) => {
|
|
7295
7295
|
if (operation !== "update") return data;
|
|
7296
7296
|
if (req.user?.collection !== slugs.supportClients) return data;
|
|
7297
|
-
const allowedStatuses = ["open", "resolved"];
|
|
7297
|
+
const allowedStatuses = ["open", "waiting_support", "resolved"];
|
|
7298
7298
|
const newData = {};
|
|
7299
7299
|
if (data.status && allowedStatuses.includes(data.status)) {
|
|
7300
7300
|
newData.status = data.status;
|
package/dist/index.js
CHANGED
|
@@ -7285,7 +7285,7 @@ function createRestrictClientUpdates(slugs) {
|
|
|
7285
7285
|
return async ({ data, operation, req, originalDoc }) => {
|
|
7286
7286
|
if (operation !== "update") return data;
|
|
7287
7287
|
if (req.user?.collection !== slugs.supportClients) return data;
|
|
7288
|
-
const allowedStatuses = ["open", "resolved"];
|
|
7288
|
+
const allowedStatuses = ["open", "waiting_support", "resolved"];
|
|
7289
7289
|
const newData = {};
|
|
7290
7290
|
if (data.status && allowedStatuses.includes(data.status)) {
|
|
7291
7291
|
newData.status = data.status;
|
package/package.json
CHANGED
|
@@ -87,7 +87,10 @@ function createRestrictClientUpdates(slugs: CollectionSlugs): CollectionBeforeCh
|
|
|
87
87
|
return async ({ data, operation, req, originalDoc }) => {
|
|
88
88
|
if (operation !== 'update') return data
|
|
89
89
|
if (req.user?.collection !== slugs.supportClients) return data
|
|
90
|
-
|
|
90
|
+
// Clients may move a ticket to: open / waiting_support (reopen) or resolved (close).
|
|
91
|
+
// 'waiting_support' is required so the reopen button actually puts the ball back
|
|
92
|
+
// in the support team's court instead of being silently rejected.
|
|
93
|
+
const allowedStatuses = ['open', 'waiting_support', 'resolved']
|
|
91
94
|
const newData: Record<string, unknown> = {}
|
|
92
95
|
if (data.status && allowedStatuses.includes(data.status as string)) {
|
|
93
96
|
newData.status = data.status
|