Skip to content

Commit

Permalink
fix: 🐛 assert on index patterns service
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Dec 3, 2020
1 parent 05e7dba commit 9dbe3f9
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const registerCreateIndexPatternRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const body = req.body;
const indexPattern = await ip.createAndSave(
body.index_pattern as IndexPatternSpec,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const registerDeleteIndexPatternRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;

await ip.delete(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const registerUpdateFieldsRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;
const {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const registerGetIndexPatternRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;
const indexPattern = await ip.get(id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const registerCreateScriptedFieldRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;
const {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const registerDeleteScriptedFieldRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;
const name = req.params.name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const registerGetScriptedFieldRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;
const name = req.params.name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const registerPutScriptedFieldRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;
const {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const registerUpdateScriptedFieldRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;
const name = req.params.name;
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const registerUpdateIndexPatternRoute = (router: IRouter) => {
router.handleLegacyErrors(
handleErrors(
assertIndexPatternsContext(async (ctx, req, res) => {
const ip = ctx.indexPatterns.indexPatterns;
const ip = ctx.indexPatterns.indexPatterns!;
const id = req.params.id;

const indexPattern = await ip.get(id);
Expand Down

0 comments on commit 9dbe3f9

Please sign in to comment.