remove settilte on child class
This commit is contained in:
parent
65a027014b
commit
5d8005df44
@ -7,6 +7,6 @@ from rest_framework.authentication import SessionAuthentication
|
||||
class DeleteView(APIView):
|
||||
permission_classes = (permissions.IsAuthenticated,)
|
||||
authentication_classes = (SessionAuthentication,)
|
||||
def post(self, request: HttpRequest):
|
||||
def delete(self, request: HttpRequest):
|
||||
request.user.delete()
|
||||
return Response("user deleted", status=status.HTTP_200_OK)
|
@ -75,6 +75,7 @@ const router = async (uri = "") => {
|
||||
if (content == null)
|
||||
return 1;
|
||||
|
||||
view.setTitle();
|
||||
document.querySelector("#app").innerHTML = content
|
||||
|
||||
await view.postInit();
|
||||
|
@ -2,8 +2,8 @@ import { client, navigateTo } from "../index.js";
|
||||
import AbstractRedirectView from "./AbstractRedirectView.js";
|
||||
|
||||
export default class extends AbstractRedirectView{
|
||||
constructor(params) {
|
||||
super(params, "/login");
|
||||
constructor(params, title) {
|
||||
super(params, title, "/login");
|
||||
}
|
||||
|
||||
async redirect()
|
||||
|
@ -2,8 +2,8 @@ import { client, navigateTo } from "../index.js";
|
||||
import AbstractRedirectView from "./AbstractRedirectView.js";
|
||||
|
||||
export default class extends AbstractRedirectView{
|
||||
constructor(params, url) {
|
||||
super(params, url);
|
||||
constructor(params, title, url) {
|
||||
super(params, title, url);
|
||||
}
|
||||
|
||||
async redirect()
|
||||
|
@ -2,9 +2,9 @@ import { navigateTo } from "../index.js";
|
||||
import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView{
|
||||
constructor(params, url)
|
||||
constructor(params, title, url)
|
||||
{
|
||||
super(params);
|
||||
super(params, title);
|
||||
this.redirect_url = url;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
export default class {
|
||||
constructor(params) {
|
||||
constructor(params, title) {
|
||||
this.params = params;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
async postInit() {
|
||||
@ -9,8 +10,8 @@ export default class {
|
||||
async leavePage() {
|
||||
}
|
||||
|
||||
setTitle(title) {
|
||||
document.title = title;
|
||||
setTitle() {
|
||||
document.title = this.title;
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
|
@ -1,9 +1,8 @@
|
||||
import AbstractView from "./AbstractView.js";
|
||||
import AbstractAuthentifiedView from "./AbstractAuthentifiedView.js";
|
||||
|
||||
export default class extends AbstractView {
|
||||
export default class extends AbstractAuthentifiedView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.setTitle("Chat");
|
||||
super(params, "Chat");
|
||||
|
||||
let url = `wss://${window.location.host}/ws/socket-server/`
|
||||
|
||||
|
@ -2,8 +2,7 @@ import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.setTitle("Dashboard");
|
||||
super(params, "Dashboard");
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
|
@ -2,8 +2,7 @@ import AbstractAuthentificateView from "./AbstractAuthentifiedView.js";
|
||||
|
||||
export default class extends AbstractAuthentificateView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.setTitle("Home");
|
||||
super(params, "Home");
|
||||
this.redirect_url = "/login"
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,8 @@ import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
super(params, "Viewing Post");
|
||||
this.postId = params.id;
|
||||
this.setTitle("Viewing Post");
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
|
@ -2,8 +2,7 @@ import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.setTitle("Posts");
|
||||
super(params, "Posts");
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
|
@ -2,8 +2,7 @@ import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.setTitle("Settings");
|
||||
super(params, "Settings");
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
|
@ -29,12 +29,11 @@ async function login()
|
||||
|
||||
export default class extends AbstractNonAuthentifiedView {
|
||||
constructor(params) {
|
||||
super(params, "/home");
|
||||
super(params, "Login", "/home");
|
||||
}
|
||||
|
||||
async postInit()
|
||||
{
|
||||
this.setTitle("Login");
|
||||
document.getElementById("button").onclick = login;
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,7 @@ import AbstractAuthentifiedView from "../AbstractAuthentifiedView.js";
|
||||
export default class extends AbstractAuthentifiedView
|
||||
{
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.setTitle("Logout");
|
||||
super(params, "Logout");
|
||||
client.logout();
|
||||
navigateTo("/login")
|
||||
}
|
||||
|
@ -24,12 +24,11 @@ async function register()
|
||||
|
||||
export default class extends AbstractAuthentifiedView {
|
||||
constructor(params) {
|
||||
super(params, "/home");
|
||||
super(params, "Register", "/home");
|
||||
}
|
||||
|
||||
async postInit()
|
||||
{
|
||||
this.setTitle("register");
|
||||
document.getElementById("button").onclick = register;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user