From 34be432af7419d32e81d18d690f41d8751ceef3f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 9 Jun 2023 04:05:19 -0400 Subject: [PATCH] refactor: use controller base class --- controller/files.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/controller/files.go b/controller/files.go index dd14d90..c3b217f 100644 --- a/controller/files.go +++ b/controller/files.go @@ -12,7 +12,7 @@ import ( ) type FilesController struct { - Ctx iris.Context + Controller } func (f *FilesController) PostUpload() { @@ -95,11 +95,7 @@ func (f *FilesController) GetStatusBy(cidString string) { break } - err := ctx.JSON(&response.StatusResponse{Status: statusCode}) - - if err != nil { - logger.Get().Error("failed to create response", zap.Error(err)) - } + f.respondJSON(&response.StatusResponse{Status: statusCode}) } func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {