Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

385 discourse metric apis #389

Merged
merged 6 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/controllers/platform.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
tokenService,
githubService,
notionService,
discourseService,
} from '../services';
import { IAuthRequest } from '../interfaces/Request.interface';
import { catchAsync, pick, ApiError } from '../utils';
Expand All @@ -17,7 +18,7 @@ import config from '../config';
import httpStatus from 'http-status';
import querystring from 'querystring';
import parentLogger from '../config/logger';
import { IPlatform, PlatformNames } from '@togethercrew.dev/db';
import { PlatformNames } from '@togethercrew.dev/db';
import { DatabaseManager } from '@togethercrew.dev/db';

const logger = parentLogger.child({ module: 'PlatformController' });
Expand Down Expand Up @@ -362,6 +363,8 @@ const getProperties = catchAsync(async function (req: IAuthAndPlatform, res: Res
let result;
if (platform?.name === PlatformNames.Discord) {
result = await discordServices.coreService.getPropertyHandler(req);
} else if (platform?.name === PlatformNames.Discourse) {
result = await discourseService.coreService.getPropertyHandler(req);
}
res.status(httpStatus.OK).send(result);
});
Expand Down
15 changes: 15 additions & 0 deletions src/docs/discourse.doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,25 @@ paths:
format: date-time
timeZone:
type: string
allCategories:
type: boolean
default: true
include:
type: array
items:
type: string
description: category id
exclude:
type: array
items:
type: string
description: category id
example:
startDate: '2023-01-17T13:02:10.911+00:00'
endDate: '2023-01-29T10:50:01.513Z'
timeZone: 'America/Fortaleza'
allCategories: false
include: [123456, 654321]
responses:
'200':
description: OK
Expand Down
Loading
Loading