Finished: tag

This commit is contained in:
2021-12-12 15:41:33 +08:00
parent 5a68cea2f3
commit dfc0b43bdd
7 changed files with 66 additions and 9 deletions

View File

@@ -7,6 +7,12 @@ function EditTag() {
id: "",
name: "",
description: "",
created_by_user: {
id: "",
username: "",
role: "",
avatar_id: "",
},
});
function refreshTagInfo() {
@@ -69,6 +75,23 @@ function EditTag() {
value={tag.id}
onChange={(e) => setTag({ ...tag, id: e.target.value })}
/>
<label htmlFor="name">Created By</label>
<input
type="text"
disabled
name="created_by_user_username"
id="created_by_user_username"
value={tag.created_by_user.username}
onChange={(e) =>
setTag({
...tag,
created_by_user: {
...tag.created_by_user,
username: e.target.value,
},
})
}
/>
<label htmlFor="name">Name</label>
<input
type="text"

View File

@@ -31,6 +31,7 @@ function Tags() {
<tr>
<th>Name</th>
<th>Description</th>
<th>Created By</th>
<th>Actions</th>
</tr>
</thead>
@@ -39,6 +40,7 @@ function Tags() {
<tr key={tag.id}>
<td>{tag.name}</td>
<td>{tag.description}</td>
<td>{tag.created_by_user.username}</td>
<td>
<Link to={`/manage/tags/${tag.id}`}>Edit</Link>
</td>