c0d3-app icon indicating copy to clipboard operation
c0d3-app copied to clipboard

Refactor constants to their own folder and files

Open kondanna opened this issue 4 years ago • 1 comments

see https://github.com/garageScript/c0d3-app/pull/1179

kondanna avatar Nov 28 '21 05:11 kondanna

@anthonykhoa wrote in discord:

I looked at the codebase today and see that there's a lot of repeated values in the codebase -- for values that are repeated and for values that have high potential to be repeated in the future, I suggest we turn them into a variable to use as a constant. Examples: /curriculum https://github.com/garageScript/c0d3-app/search?p=1&q=%2F%2Fcurriculum

Auth headers such as Authorization and content-type(content-type is capitalized differently on different files.. and it works, but it makes our codebase less consistent when we use different capitalizations for the same word) https://github.com/garageScript/c0d3-app/search?q=content-type https://github.com/garageScript/c0d3-app/search?q=authorization

Day and Days https://github.com/garageScript/c0d3-app/search?q=day https://github.com/garageScript/c0d3-app/search?q=days

Errors about session not existing(this file has several examples of a repeated string value Session Error) https://github.com/garageScript/c0d3-app/blob/master/graphql/resolvers/authController.ts#L100

No user error(theres more examples than just this file, but its hard to find them all because they use different error messages) https://github.com/garageScript/c0d3-app/blob/master/graphql/resolvers/moduleCrud.ts#L46

/assets https://github.com/garageScript/c0d3-app/search?q=%2F%2Fassets

SlyBouhafs avatar Mar 20 '22 13:03 SlyBouhafs