fix: change return payload on snippet api

This commit is contained in:
Innei
2021-12-31 22:12:19 +08:00
parent 9940e9fbcf
commit 9573f47479
2 changed files with 3 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ export class SnippetController {
if (snippet.private && !isMaster) {
throw new ForbiddenException('snippet is private')
}
return snippet
return snippet.data
}
@Put('/:id')

View File

@@ -100,11 +100,12 @@ export class SnippetService {
break
}
case SnippetType.Text: {
Reflect.set(model, 'data', model.raw)
break
}
}
return model
return model as SnippetModel & { data: any }
}
// TODO serverless function