@bakery-framework/plugin-dashboard 2.1.1 → 2.2.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakery-framework/plugin-dashboard",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Bakery dashboard plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bakery",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"!src/tests"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@bakery-framework/core": "^2.
|
|
37
|
-
"@bakery-framework/plugin-analytics": "^2.
|
|
36
|
+
"@bakery-framework/core": "^2.2.0",
|
|
37
|
+
"@bakery-framework/plugin-analytics": "^2.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@bakery-framework/orm": "^2.
|
|
40
|
+
"@bakery-framework/orm": "^2.2.0"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"bun": ">=1.4.0"
|
|
@@ -15,7 +15,7 @@ export async function handleGetSessions(
|
|
|
15
15
|
const sortBy = url.searchParams.get('sortBy') || 'accessed'
|
|
16
16
|
const sortOrder = url.searchParams.get('sortOrder') === 'ASC' ? 'ASC' : 'DESC'
|
|
17
17
|
|
|
18
|
-
const result = await Session.
|
|
18
|
+
const result = await Session.page({
|
|
19
19
|
search,
|
|
20
20
|
page,
|
|
21
21
|
pageSize,
|
|
@@ -30,7 +30,7 @@ export async function handleDeleteSession(
|
|
|
30
30
|
req: Request,
|
|
31
31
|
): Promise<JsonResponseData<unknown>> {
|
|
32
32
|
const body = await processBody(req)
|
|
33
|
-
const deleted = body?.id && Session.
|
|
33
|
+
const deleted = typeof body?.id === 'string' && (await Session.end(body.id))
|
|
34
34
|
return deleted
|
|
35
35
|
? response.json.success('Session deleted')
|
|
36
36
|
: response.json.error(404, 'Session not found')
|
|
@@ -55,5 +55,10 @@ export async function handleUpdateSession(
|
|
|
55
55
|
if (!session) return response.json.error(404, 'Session not found')
|
|
56
56
|
|
|
57
57
|
remove ? session.delete(key) : session.set(key, value)
|
|
58
|
+
// Stored now, in whichever store holds it. The edit used to wait for the
|
|
59
|
+
// session's own next response, and was lost if that never came.
|
|
60
|
+
if (!(await Session.save(session))) {
|
|
61
|
+
return response.json.error(404, 'Session not found')
|
|
62
|
+
}
|
|
58
63
|
return response.json.success('Session updated', { id, key, value, remove })
|
|
59
64
|
}
|