feat: add SetValidatedDTOInContext to support test helper functions
This commit is contained in:
@@ -77,3 +77,7 @@ func GetDTOTypeFromContext(ctx context.Context) reflect.Type {
|
|||||||
func GetValidatedDTOFromContext(ctx context.Context) any {
|
func GetValidatedDTOFromContext(ctx context.Context) any {
|
||||||
return ctx.Value(validatedDTOKey)
|
return ctx.Value(validatedDTOKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetValidatedDTOInContext(ctx context.Context, dto any) context.Context {
|
||||||
|
return context.WithValue(ctx, validatedDTOKey, dto)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user