Page MenuHomeSealhub

me-subject.ts
No OneTemporary

me-subject.ts

import { LeafSubject } from "../subject";
import * as Errors from "../../response/errors";
import { ActionName } from "../../action";
import Context from "../../context";
export default class MeSubject extends LeafSubject {
async performAction(
context: Context,
action_name: ActionName,
params: any
) {
if (!context.user_id) {
throw new Errors.InvalidCredentials("You're not logged in!");
}
try {
return await this.app.runAction(
context,
["collections", "users", context.user_id],
action_name,
params
);
} catch (error) {
if (error.type === "not_found") {
throw new Errors.InvalidCredentials("You're not logged in!");
}
throw error;
}
}
getName() {
return "me";
}
}

File Metadata

Mime Type
text/x-java
Expires
Tue, Dec 24, 14:02 (18 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557235
Default Alt Text
me-subject.ts (730 B)

Event Timeline