Skip to content

Conversation

@arvid-e
Copy link
Contributor

@arvid-e arvid-e commented Oct 2, 2025

https://redmine.weseek.co.jp/issues/171499
https://redmine.weseek.co.jp/issues/171501

GET _api/v3/user-activities/

Response

{
    "serializedPaginationResult": {
        "docs": [
            {
                "user": {
                    "_id": "68b67e2a149f8bd7ae01be8d",
                    "name": "admin",
                    "username": "admin",
                    "imageUrlCached": "/images/icons/user.svg"
                },
                "_id": "68e37c45f19a37f3a0617c33",
                "action": "PAGE_UPDATE",
                "createdAt": "2025-10-06T08:22:29.976Z",
                "target": "68e37c3ef19a37f3a0617b31",
                "targetModel": "Page"
            },
            {
                "user": {
                    "_id": "68b67e2a149f8bd7ae01be8d",
                    "name": "admin",
                    "username": "admin",
                    "imageUrlCached": "/images/icons/user.svg"
                },
                "_id": "68d4ccde3aa503a3ea9b75b6",
                "action": "PAGE_UPDATE",
                "createdAt": "2025-09-25T05:02:22.531Z",
                "target": "68d4ccd43aa503a3ea9b74bc",
                "targetModel": "Page"
            }
        ],
        "totalDocs": 2,
        "limit": 20,
        "offset": 0,
        "page": 1,
        "totalPages": 1,
        "hasPrevPage": false,
        "hasNextPage": false
    }
}

@arvid-e arvid-e force-pushed the feat/171501-api-for-activity-log branch from ea09479 to b97512d Compare October 2, 2025 10:16
@arvid-e arvid-e requested a review from yuki-takei October 6, 2025 09:07
router.get('/',
loginRequiredStrictly, validator.list, apiV3FormValidator, async(req: AuthorizedRequest, res: ApiV3Response) => {

const defaultLimit = String(configManager.getConfig('customize:showPageLimitationS'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

キャストしなくても返り値は string 型のはず


const defaultLimit = String(configManager.getConfig('customize:showPageLimitationS'));
const limit: number = parseInt(req.query.limit as string || defaultLimit, 10) || 10;
const offset: number = parseInt(req.query.offset as string || '0', 10) || 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import type { Request } from 'express'; と generics を使って、limit と offset の as string を書かなくて済むようにしてください

@arvid-e arvid-e merged commit 3390062 into feat/171499-activity-log Oct 14, 2025
14 checks passed
@arvid-e arvid-e deleted the feat/171501-api-for-activity-log branch October 14, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants