Compare commits

..

No commits in common. "b5c29872818184fa95e2bd029dc83e0b35fb7898" and "3a7663124d92fcfdefb02103119e0c9aec8afed2" have entirely different histories.

3 changed files with 0 additions and 27 deletions

View file

@ -71,7 +71,6 @@ func main() {
server.Post("/api/loginrenew", gs.LoginRenew) server.Post("/api/loginrenew", gs.LoginRenew)
server.Delete("/api/userdelete", gs.UserDelete) // Perhaps just use POST to avoid headaches server.Delete("/api/userdelete", gs.UserDelete) // Perhaps just use POST to avoid headaches
server.Post("/api/project", gs.CreateProject)
// Announce the port we are listening on and start the server // Announce the port we are listening on and start the server
err = server.Listen(fmt.Sprintf(":%d", conf.Port)) err = server.Listen(fmt.Sprintf(":%d", conf.Port))

View file

@ -1,4 +1,3 @@
import { NewProject, Project } from "../Types/Project";
import { NewUser, User } from "../Types/Users"; import { NewUser, User } from "../Types/Users";
// Defines all the methods that an instance of the API must implement // Defines all the methods that an instance of the API must implement
@ -7,8 +6,6 @@ interface API {
registerUser(user: NewUser): Promise<User>; registerUser(user: NewUser): Promise<User>;
/** Remove a user */ /** Remove a user */
removeUser(username: string): Promise<User>; removeUser(username: string): Promise<User>;
/** Create a project */
createProject(project: NewProject): Promise<Project>;
} }
// Export an instance of the API // Export an instance of the API
@ -32,14 +29,4 @@ export const api: API = {
body: JSON.stringify(username), body: JSON.stringify(username),
}).then((res) => res.json() as Promise<User>); }).then((res) => res.json() as Promise<User>);
}, },
async createProject(project: NewProject): Promise<Project> {
return fetch("/api/project", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(project),
}).then((res) => res.json() as Promise<Project>);
},
}; };

View file

@ -1,13 +0,0 @@
export interface Project {
id: number;
name: string;
description: string;
owner: string;
created: string; // This is a date
}
export interface NewProject {
name: string;
description: string;
owner: string;
}