forked from ebhomengo/niki
19 lines
600 B
Go
19 lines
600 B
Go
|
package mysqlkindboxreq
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
errmsg "git.gocasts.ir/ebhomengo/niki/pkg/err_msg"
|
||
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func (d DB) DeleteKindBoxReqByID(ctx context.Context, kindBoxReqID uint) error {
|
||
|
const op = richerror.Op("mysqlkindboxreq.DeleteKindBoxReqByID")
|
||
|
_, dErr := d.conn.Conn().ExecContext(ctx, "update kind_box_reqs set deleted_at = ? where id = ? ", time.Now(), kindBoxReqID)
|
||
|
if dErr != nil {
|
||
|
return richerror.New(op).WithErr(dErr).
|
||
|
WithMessage(errmsg.ErrorMsgSomethingWentWrong).WithKind(richerror.KindUnexpected)
|
||
|
}
|
||
|
return nil
|
||
|
}
|