mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-06 00:36:39 +00:00
set project creator as member on creation
This commit is contained in:
parent
df38a0b74e
commit
302ca0c0ae
6 changed files with 12 additions and 8 deletions
|
|
@ -180,11 +180,15 @@ namespace TicketManager.Controllers
|
||||||
EndingDate = projectDto.EndingDate,
|
EndingDate = projectDto.EndingDate,
|
||||||
Manager = await _context.AppUsers.FindAsync(projectDto.ManagerId)
|
Manager = await _context.AppUsers.FindAsync(projectDto.ManagerId)
|
||||||
};
|
};
|
||||||
// project.LogAction(
|
|
||||||
// $"{project.Title} has been created by {project.Manager.FullName}.",
|
|
||||||
// ActivityType.StartTask);
|
|
||||||
|
|
||||||
_context.Projects.Add(project);
|
_context.Projects.Add(project);
|
||||||
|
_context.Assignments.Add(new Assignment()
|
||||||
|
{
|
||||||
|
Project = project,
|
||||||
|
ProjectId = project.Id,
|
||||||
|
User = project.Manager,
|
||||||
|
UserId = project.Manager.Id
|
||||||
|
});
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
var dto = new ProjectDTO(project);
|
var dto = new ProjectDTO(project);
|
||||||
return CreatedAtAction("GetProject", new { id = project.Id }, dto);
|
return CreatedAtAction("GetProject", new { id = project.Id }, dto);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ namespace TicketManager.Resources
|
||||||
[Required]
|
[Required]
|
||||||
public DateTime EndingDate { get; set; }
|
public DateTime EndingDate { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
public Guid ManagerId { get; set; }
|
public string ManagerId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
app.db
BIN
app.db
Binary file not shown.
|
|
@ -46,8 +46,7 @@ export default function ButtonAppBar() {
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Typography variant="h6" className={classes.title}>
|
<Typography variant="h6" className={classes.title}>
|
||||||
<Button color="inherit" component={Link} to={ROUTES.HOME}>
|
<Button color="inherit" component={Link} to={ROUTES.HOME}>
|
||||||
{/* <Button color="inherit" href={ROUTES.HOME}> */}
|
BugBuster
|
||||||
🐞BugBuster
|
|
||||||
</Button>
|
</Button>
|
||||||
</Typography>
|
</Typography>
|
||||||
{!isAuthenticated ? (
|
{!isAuthenticated ? (
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
|
import { Link as RouterLink } from "react-router-dom";
|
||||||
import { Container, Typography, Link } from "@material-ui/core";
|
import { Container, Typography, Link } from "@material-ui/core";
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
|
|
||||||
|
|
@ -16,7 +17,7 @@ const Copyright: FC<IProps> = ({ brand, text }) => {
|
||||||
return (
|
return (
|
||||||
<Typography variant="body2" color="textSecondary">
|
<Typography variant="body2" color="textSecondary">
|
||||||
{"© "}
|
{"© "}
|
||||||
<Link color="inherit" href="/">
|
<Link color="inherit" component={RouterLink} to="/">
|
||||||
{brand}
|
{brand}
|
||||||
</Link>{" "}
|
</Link>{" "}
|
||||||
{new Date().getFullYear()}
|
{new Date().getFullYear()}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const NewProjectModal: FC<IProps> = ({ show, handleClose }) => {
|
||||||
title: title,
|
title: title,
|
||||||
description: description,
|
description: description,
|
||||||
endingDate: new Date(endingDate).toISOString(),
|
endingDate: new Date(endingDate).toISOString(),
|
||||||
managerId: getUID(user), // get current User id
|
managerId: getUID(user),
|
||||||
};
|
};
|
||||||
|
|
||||||
const token = await getTokenSilently();
|
const token = await getTokenSilently();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue