mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: use validated and stripped data when updating
This commit is contained in:
parent
192c292ecf
commit
ef5b67974d
@ -87,11 +87,13 @@ class ContextController extends Controller {
|
|||||||
try {
|
try {
|
||||||
await this.store.get(name);
|
await this.store.get(name);
|
||||||
|
|
||||||
await contextSchema.validateAsync(updatedContextField);
|
const value = await contextSchema.validateAsync(
|
||||||
|
updatedContextField,
|
||||||
|
);
|
||||||
await this.eventStore.store({
|
await this.eventStore.store({
|
||||||
type: CONTEXT_FIELD_UPDATED,
|
type: CONTEXT_FIELD_UPDATED,
|
||||||
createdBy: userName,
|
createdBy: userName,
|
||||||
data: updatedContextField,
|
data: value,
|
||||||
});
|
});
|
||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user