managers: introduces managers model for viewer

This commit is contained in:
@wwwjim 2020-07-23 17:22:22 -07:00
parent 595c59ee71
commit f0cfe53c74
3 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@ import * as Utilities from "~/node_common/utilities";
import * as Data from "~/node_common/data";
import * as Powergate from "~/node_common/powergate";
export const getViewer = async ({ id }) => {
export const getById = async ({ id }) => {
const user = await Data.getUserById({
id,
});

View File

@ -1,5 +1,5 @@
import * as MW from "~/node_common/middleware";
import * as Models from "~/node_common/models";
import * as ViewerManager from "~/node_common/managers/viewer";
import * as Utilities from "~/node_common/utilities";
const initCORS = MW.init(MW.CORS);
@ -16,7 +16,7 @@ export default async (req, res) => {
.json({ decorator: "SERVER_USER_DELETE", error: true });
}
const data = await Models.getViewer({ id });
const data = await ViewerManager.getById({ id });
return res
.status(200)

View File

@ -1,9 +1,9 @@
import * as Environment from "~/node_common/environment";
import * as Strings from "./common/strings";
import * as Constants from "./node_common/constants";
import * as Data from "~/node_common/data";
import * as Models from "~/node_common/models";
import * as ViewerManager from "~/node_common/managers/viewer";
import * as Utilities from "~/node_common/utilities";
import * as Strings from "./common/strings";
import express from "express";
import next from "next";
@ -32,7 +32,7 @@ app.prepare().then(async () => {
let viewer = null;
if (id) {
viewer = await Models.getViewer({
viewer = await ViewerManager.getById({
id,
});
}
@ -48,7 +48,7 @@ app.prepare().then(async () => {
let viewer = null;
if (id) {
viewer = await Models.getViewer({
viewer = await ViewerManager.getById({
id,
});
}