mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-23 17:12:53 +03:00
managers: introduces managers model for viewer
This commit is contained in:
parent
595c59ee71
commit
f0cfe53c74
@ -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,
|
||||
});
|
@ -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)
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user