fix: apply link email mark optional
This commit is contained in:
@@ -67,7 +67,7 @@ export class LinkController {
|
||||
|
||||
process.nextTick(async () => {
|
||||
if (doc.email) {
|
||||
this.linkService.sendToCandidate(doc)
|
||||
await this.linkService.sendToCandidate(doc)
|
||||
}
|
||||
})
|
||||
return
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { modelOptions, prop } from '@typegoose/typegoose'
|
||||
import { Transform } from 'class-transformer'
|
||||
import { IsEmail, IsEnum, IsOptional, IsString, IsUrl } from 'class-validator'
|
||||
import { range } from 'lodash'
|
||||
import { BaseModel } from '~/shared/model/base.model'
|
||||
@@ -32,6 +33,8 @@ export class LinkModel extends BaseModel {
|
||||
@IsOptional()
|
||||
@IsUrl({ require_protocol: true })
|
||||
@prop({ trim: true })
|
||||
// 对空字符串处理
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
avatar?: string
|
||||
|
||||
@IsOptional()
|
||||
@@ -52,6 +55,9 @@ export class LinkModel extends BaseModel {
|
||||
|
||||
@prop()
|
||||
@IsEmail()
|
||||
@IsOptional()
|
||||
// 对空字符串处理
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
email?: string
|
||||
get hide() {
|
||||
return this.state === LinkState.Audit
|
||||
|
||||
@@ -84,12 +84,11 @@ export class LinkService {
|
||||
站点描述: ${model.description}`)
|
||||
return
|
||||
}
|
||||
process.nextTick(async () => {
|
||||
await this.emailService.sendLinkApplyEmail({
|
||||
model,
|
||||
to: model.email,
|
||||
template: LinkApplyEmailType.ToCandidate,
|
||||
})
|
||||
|
||||
await this.emailService.sendLinkApplyEmail({
|
||||
model,
|
||||
to: model.email,
|
||||
template: LinkApplyEmailType.ToCandidate,
|
||||
})
|
||||
}
|
||||
async sendToMaster(authorName: string, model: LinkModel) {
|
||||
|
||||
@@ -117,7 +117,7 @@ export class PageProxyController {
|
||||
`<!-- injectable script -->`,
|
||||
`<script>${`window.page_source='${
|
||||
source.from
|
||||
}'};\nwindow.injectData = ${JSON.stringify({
|
||||
}';\nwindow.injectData = ${JSON.stringify({
|
||||
LOGIN_BG: adminExtra.background,
|
||||
TITLE: adminExtra.title,
|
||||
WEB_URL: webUrl,
|
||||
|
||||
Reference in New Issue
Block a user