mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-30 19:07:58 +03:00
rename import-course to import/course for backcompat
This commit is contained in:
@@ -63,7 +63,7 @@ t.test("POST /ir/lr2hook/import", (t) => {
|
||||
t.end();
|
||||
});
|
||||
|
||||
t.test("POST /ir/lr2hook/import-course", (t) => {
|
||||
t.test("POST /ir/lr2hook/import/course", (t) => {
|
||||
t.beforeEach(ResetDBState);
|
||||
|
||||
const classBody: LR2HookScore = {
|
||||
@@ -92,7 +92,7 @@ t.test("POST /ir/lr2hook/import-course", (t) => {
|
||||
|
||||
t.test("Should update a user's class if necessary.", async (t) => {
|
||||
const res = await mockApi
|
||||
.post("/ir/lr2hook/import-course")
|
||||
.post("/ir/lr2hook/import/course")
|
||||
.set("Authorization", "Bearer fake_api_token")
|
||||
.send(classBody);
|
||||
|
||||
@@ -113,7 +113,7 @@ t.test("POST /ir/lr2hook/import-course", (t) => {
|
||||
|
||||
t.test("Should not update a user's class if they didn't clear the course.", async (t) => {
|
||||
const res = await mockApi
|
||||
.post("/ir/lr2hook/import-course")
|
||||
.post("/ir/lr2hook/import/course")
|
||||
.set("Authorization", "Bearer fake_api_token")
|
||||
.send(deepmerge(classBody, { scoreData: { notesPlayed: 1 } }));
|
||||
|
||||
@@ -133,7 +133,7 @@ t.test("POST /ir/lr2hook/import-course", (t) => {
|
||||
|
||||
t.test("Should 404 if the course doesn't exist.", async (t) => {
|
||||
const res = await mockApi
|
||||
.post("/ir/lr2hook/import-course")
|
||||
.post("/ir/lr2hook/import/course")
|
||||
.set("Authorization", "Bearer fake_api_token")
|
||||
.send(deepmerge(classBody, { md5: "some nonsense" }));
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ router.post("/import", async (req, res) => {
|
||||
/**
|
||||
* Import a course in the LR2Hook format.
|
||||
*
|
||||
* @name POST /ir/lr2hook/import-course
|
||||
* @name POST /ir/lr2hook/import/course
|
||||
*/
|
||||
router.post("/import-course", prValidate(PR_LR2Hook), async (req, res) => {
|
||||
router.post("/import/course", prValidate(PR_LR2Hook), async (req, res) => {
|
||||
// notably, courses in LR2 are actually identical to scores. They have all
|
||||
// the same fields in all the same ways. The only significant difference is that
|
||||
// the md5 field is 4 fields conjoined, rather than just one.
|
||||
|
||||
Reference in New Issue
Block a user