1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: use validated and stripped data when updating

This commit is contained in:
Ivar Conradi Østhus 2020-10-01 22:40:47 +02:00
parent 192c292ecf
commit ef5b67974d

View File

@ -87,11 +87,13 @@ class ContextController extends Controller {
try {
await this.store.get(name);
await contextSchema.validateAsync(updatedContextField);
const value = await contextSchema.validateAsync(
updatedContextField,
);
await this.eventStore.store({
type: CONTEXT_FIELD_UPDATED,
createdBy: userName,
data: updatedContextField,
data: value,
});
res.status(200).end();
} catch (error) {