fix: change return payload on snippet api
This commit is contained in:
@@ -74,7 +74,7 @@ export class SnippetController {
|
||||
if (snippet.private && !isMaster) {
|
||||
throw new ForbiddenException('snippet is private')
|
||||
}
|
||||
return snippet
|
||||
return snippet.data
|
||||
}
|
||||
|
||||
@Put('/:id')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user