Skip to content

Commit

Permalink
feat: v3.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Mar 1, 2022
1 parent 74b5224 commit 847f881
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodepress",
"version": "3.9.0",
"version": "3.9.1",
"description": "RESTful API service for Surmon.me blog",
"author": {
"name": "Surmon",
Expand Down
4 changes: 2 additions & 2 deletions src/modules/article/article.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export class Article {

@IsString()
@IsOptional()
@prop({ default: null })
thumb: null | string
@prop({ type: String, default: null })
thumb: string | null

// publish state
@IsIn(ARTICLE_PUBLISH_STATES)
Expand Down
14 changes: 7 additions & 7 deletions src/modules/comment/comment.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ export class Author {
@IsEmail()
@IsString()
@IsOptional()
@prop({ default: null })
@prop({ type: String, default: null })
email?: string | null

@IsUrl({ require_protocol: true })
@IsString()
@IsOptional()
@prop({ default: null })
@prop({ type: String, default: null })
site?: string | null

public get email_hash() {
Expand Down Expand Up @@ -96,7 +96,7 @@ export class CommentBase {

// user agent
@IsString()
@prop({ default: null })
@prop({ type: String, default: null })
agent?: string | null

@Type(() => Author)
Expand Down Expand Up @@ -142,12 +142,12 @@ export class Comment extends CommentBase {
// IP address
@IsIP()
@IsOptional()
@prop({ default: null })
ip: null | string
@prop({ type: String, default: null })
ip: string | null

// IP location
@prop({ default: null, type: Object })
ip_location: null | (Partial<IPLocation> & { [key: string]: any })
@prop({ type: Object, default: null })
ip_location: Partial<IPLocation> | null

@prop({ default: Date.now, immutable: true })
create_at?: Date
Expand Down
19 changes: 9 additions & 10 deletions src/modules/feedback/feedback.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ export class FeedbackBase {
@MaxLength(20)
@IsString()
@IsOptional()
@prop({ default: null })
user_name: null | string
@prop({ type: String, default: null })
user_name: string | null

@IsEmail()
@IsString()
@IsOptional()
@prop({ default: null })
user_email: null | string
@prop({ type: String, default: null })
user_email: string | null
}

@plugin(mongoosePaginate)
Expand Down Expand Up @@ -134,21 +134,20 @@ export class Feedback extends FeedbackBase {

@IsString()
@IsOptional()
@prop({ default: null })
origin: null | string
@prop({ type: String, default: null })
origin: string | null

@IsString()
@prop({ default: null })
user_agent?: string

@IsIP()
@IsOptional()
@prop({ default: null })
@prop({ type: String, default: null })
ip: null | string

// IP location
@prop({ default: null, type: Object })
ip_location: null | (Partial<IPLocation> & { [key: string]: any })
@prop({ type: Object, default: null })
ip_location: Partial<IPLocation> | null

@prop({ default: Date.now, immutable: true })
create_at?: Date
Expand Down
5 changes: 3 additions & 2 deletions src/modules/option/option.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export class Option {

@IsString()
@IsOptional()
@prop({ required: true })
@IsNotEmpty()
@prop({ default: '' })
statement: string

@ArrayUnique()
Expand All @@ -139,7 +140,7 @@ export class Option {
// ad config
@IsString()
@IsOptional()
@prop({ default: null })
@prop({ type: String, default: null })
ad_config: string | null

@prop({ default: Date.now })
Expand Down
1 change: 1 addition & 0 deletions src/processors/helper/helper.service.ip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface IPLocation {
region_code: string
city: string
zip: string
[key: string]: any
}

@Injectable()
Expand Down

0 comments on commit 847f881

Please sign in to comment.