Fix: Removed updatedAt from project list (#853)

This commit is contained in:
Ary
2024-04-03 13:35:18 -06:00
committed by GitHub
parent 8b8b3347fb
commit 9f207dd39a
5 changed files with 3 additions and 12 deletions
@@ -43,8 +43,7 @@ export default function ProjectList() {
<thead>
<tr>
<th className={style.containCell}>Project Name</th>
<th>Date Created</th>
<th>Date Modified</th>
<th>Last Used</th>
<th />
</tr>
</thead>
@@ -53,7 +52,6 @@ export default function ProjectList() {
<ProjectListItem
key={project.filename}
filename={project.filename}
createdAt={project.createdAt}
updatedAt={project.updatedAt}
onToggleEditMode={handleToggleEditMode}
onSubmit={handleClear}
@@ -21,7 +21,6 @@ export type EditMode = 'rename' | 'duplicate' | null;
interface ProjectListItemProps {
current?: boolean;
filename: string;
createdAt: string;
updatedAt: string;
onToggleEditMode: (editMode: EditMode, filename: string | null) => void;
onSubmit: () => void;
@@ -32,14 +31,13 @@ interface ProjectListItemProps {
export default function ProjectListItem({
current,
createdAt,
updatedAt,
editingFilename,
editingMode,
filename,
onRefetch,
onSubmit,
onToggleEditMode,
updatedAt,
}: ProjectListItemProps) {
const [submitError, setSubmitError] = useState<string | null>(null);
@@ -102,7 +100,6 @@ export default function ProjectListItem({
) : (
<>
<td className={style.containCell}>{filename}</td>
<td>{new Date(createdAt).toLocaleString()}</td>
<td>{new Date(updatedAt).toLocaleString()}</td>
<td className={style.actionButton}>
<ActionMenu
@@ -67,8 +67,7 @@ export async function handleUploadedFile(filePath: string, name: string) {
*
* @returns {Promise<Array<ProjectFile>>} A promise that resolves to an array of ProjectFile objects,
* each representing a file in the 'uploads' folder with its metadata.
* The metadata includes the filename, creation time (createdAt),
* and last modification time (updatedAt) of each file.
* The metadata includes the filename, creation or overwriting time (updatedAt)
*
* @throws {Error} Throws an error if there is an issue in reading the directory or fetching file statistics.
*/
@@ -83,7 +82,6 @@ export async function getProjectFiles(): Promise<ProjectFile[]> {
projectFiles.push({
filename: removeFileExtension(file),
createdAt: stats.birthtime.toISOString(),
updatedAt: stats.mtime.toISOString(),
});
}
@@ -23,7 +23,6 @@ describe('getProjectFiles test', () => {
const expectedFiles = ['file1', 'file2', 'file3'].map((file) => ({
filename: file,
createdAt: new Date('2020-01-01').toISOString(),
updatedAt: new Date('2021-01-01').toISOString(),
}));
@@ -15,7 +15,6 @@ export interface GetInfo {
export type ProjectFile = {
filename: string;
createdAt: string;
updatedAt: string;
};