From f3ec968dbb8f63c8d4859c2f881514f117137c20 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Tue, 26 Jul 2022 02:56:07 +0000 Subject: [PATCH] Development --- api/article/routes.mjs | 6 +++--- api/authentication/routes.mjs | 2 +- api/page/model.mjs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/article/routes.mjs b/api/article/routes.mjs index 47764c9..e8a223f 100644 --- a/api/article/routes.mjs +++ b/api/article/routes.mjs @@ -11,7 +11,7 @@ export default class ArticleRoutes { /** GET: /api/articles/[path] */ async getArticle(ctx) { - let res = await ctx.db.safeCallProc('article_get_single', [ctx.params.path]) + let res = await ctx.db.safeCallProc('common.article_get_single', [ctx.params.path]) let out = { article: parseArticle(res.results[0][0]), @@ -23,7 +23,7 @@ export default class ArticleRoutes { /** GET: /api/auth/articles */ async auth_getAllArticles(ctx) { - let res = await ctx.db.safeCallProc('article_auth_get_all', [ + let res = await ctx.db.safeCallProc('common.article_auth_get_all', [ ctx.state.auth_token, Math.max(ctx.query.get('page') || 1, 1), Math.min(ctx.query.get('per_page') || 10, 25) @@ -101,7 +101,7 @@ export default class ArticleRoutes { } } console.log(params) - let res = await ctx.db.safeCallProc('article_auth_get_update_create', params) + let res = await ctx.db.safeCallProc('common.article_auth_get_update_create', params) let out = { article: parseArticle(res.results[0][0]), diff --git a/api/authentication/routes.mjs b/api/authentication/routes.mjs index 2c2fdf1..0ba4f43 100644 --- a/api/authentication/routes.mjs +++ b/api/authentication/routes.mjs @@ -13,7 +13,7 @@ export default class AuthenticationRoutes { /** GET: /api/authentication/login */ async login(ctx) { - let res = await ctx.db.safeCallProc('dbo.common_auth_login', [ + let res = await ctx.db.safeCallProc('common.auth_login', [ ctx.req.body.email, ctx.req.body.password, ]) diff --git a/api/page/model.mjs b/api/page/model.mjs index 3f25f38..44038e8 100644 --- a/api/page/model.mjs +++ b/api/page/model.mjs @@ -1,7 +1,7 @@ import { parseFile } from '../file/util.mjs' export async function getTree(ctx) { - let res = await ctx.db.safeCallProc('pages_get_tree', []) + let res = await ctx.db.safeCallProc('common.pages_get_tree', []) let out = [] let children = [] let map = new Map() @@ -26,7 +26,7 @@ export async function getTree(ctx) { } export async function getPage(ctx, path, page = 0, per_page = 10) { - let res = await ctx.db.safeCallProc('pages_get_single', [path, page, per_page]) + let res = await ctx.db.safeCallProc('common.pages_get_single', [path, page, per_page]) let articleMap = new Map()