mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
moving name out of file, will mirror file system name
This commit is contained in:
@@ -34,8 +34,9 @@ const getAssignment = async (
|
||||
assignmentName + ".md"
|
||||
);
|
||||
const rawFile = (await fs.readFile(filePath, "utf-8")).replace(/\r\n/g, "\n");
|
||||
return localAssignmentMarkdown.parseMarkdown(rawFile);
|
||||
return localAssignmentMarkdown.parseMarkdown(rawFile, assignmentName);
|
||||
};
|
||||
|
||||
export const assignmentsFileStorageService = {
|
||||
getAssignmentNames,
|
||||
getAssignment,
|
||||
@@ -72,7 +73,6 @@ export const assignmentsFileStorageService = {
|
||||
assignmentMarkdownSerializer.toMarkdown(assignment);
|
||||
console.log(`Saving assignment ${filePath}`);
|
||||
|
||||
|
||||
await fs.writeFile(filePath, assignmentMarkdown);
|
||||
},
|
||||
async delete({
|
||||
|
||||
@@ -56,11 +56,12 @@ const getItem = async <T extends CourseItemType>(
|
||||
const rawFile = (await fs.readFile(filePath, "utf-8")).replace(/\r\n/g, "\n");
|
||||
if (type === "Assignment") {
|
||||
return localAssignmentMarkdown.parseMarkdown(
|
||||
rawFile
|
||||
rawFile,
|
||||
name
|
||||
) as CourseItemReturnType<T>;
|
||||
} else if (type === "Quiz") {
|
||||
return localQuizMarkdownUtils.parseMarkdown(
|
||||
rawFile
|
||||
rawFile, name
|
||||
) as CourseItemReturnType<T>;
|
||||
} else if (type === "Page") {
|
||||
return localPageMarkdownUtils.parseMarkdown(
|
||||
|
||||
Reference in New Issue
Block a user