mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
[CORL-239, CORL-128] Support disabled commenting and closed stories in Stream (#2205)
* feat: closed story + disabled commenting * test: add feature test and fix bugs * fix: snapshot * fix: isClosed can't be null * fix: remove duplicate DeepPartial type * fix: border color
This commit is contained in:
@@ -189,6 +189,22 @@ export class TalkError extends VError {
|
||||
}
|
||||
}
|
||||
|
||||
export class CommentingDisabledError extends TalkError {
|
||||
constructor() {
|
||||
super({
|
||||
code: ERROR_CODES.COMMENTING_DISABLED,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class StoryClosedError extends TalkError {
|
||||
constructor() {
|
||||
super({
|
||||
code: ERROR_CODES.STORY_CLOSED,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class CommentBodyTooShortError extends TalkError {
|
||||
constructor(min: number) {
|
||||
super({
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ERROR_CODES } from "talk-common/errors";
|
||||
|
||||
export const ERROR_TRANSLATIONS: Record<ERROR_CODES, string> = {
|
||||
COMMENTING_DISABLED: "error-commentingDisabled",
|
||||
STORY_CLOSED: "error-storyClosed",
|
||||
COMMENT_BODY_TOO_SHORT: "error-commentBodyTooShort",
|
||||
COMMENT_BODY_EXCEEDS_MAX_LENGTH: "error-commentBodyExceedsMaxLength",
|
||||
STORY_URL_NOT_PERMITTED: "error-storyURLNotPermitted",
|
||||
|
||||
Reference in New Issue
Block a user