renaming api module to webapi
This commit is contained in:
parent
0b40b9d92c
commit
313785b4ac
21 changed files with 247 additions and 238 deletions
|
@ -1,8 +1,8 @@
|
|||
import { Column, CreateDateColumn, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { apiPermission } from "./api_permission";
|
||||
import { webapiPermission } from "./webapi_permission";
|
||||
|
||||
@Entity()
|
||||
export class api {
|
||||
export class webapi {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
|
@ -21,6 +21,6 @@ export class api {
|
|||
@Column({ type: "datetime", nullable: true })
|
||||
expiry?: Date;
|
||||
|
||||
@OneToMany(() => apiPermission, (apiPermission) => apiPermission.api)
|
||||
permissions: apiPermission[];
|
||||
@OneToMany(() => webapiPermission, (apiPermission) => apiPermission.webapi)
|
||||
permissions: webapiPermission[];
|
||||
}
|
|
@ -1,19 +1,19 @@
|
|||
import { Column, Entity, ManyToOne, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { PermissionObject, PermissionString } from "../../type/permissionTypes";
|
||||
import { api } from "./api";
|
||||
import { webapi } from "./webapi";
|
||||
|
||||
@Entity()
|
||||
export class apiPermission {
|
||||
export class webapiPermission {
|
||||
@PrimaryColumn({ type: "int" })
|
||||
apiId: number;
|
||||
webapiId: number;
|
||||
|
||||
@PrimaryColumn({ type: "varchar", length: 255 })
|
||||
permission: PermissionString;
|
||||
|
||||
@ManyToOne(() => api, {
|
||||
@ManyToOne(() => webapi, {
|
||||
nullable: false,
|
||||
onDelete: "CASCADE",
|
||||
onUpdate: "RESTRICT",
|
||||
})
|
||||
api: api;
|
||||
webapi: webapi;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue