Skip to content

Commit

Permalink
refactor(database): ♻️ Move Token to its own ORM abstraction, optimiz…
Browse files Browse the repository at this point in the history
…e familiar_followers route
  • Loading branch information
CPlusPatch committed Nov 3, 2024
1 parent 962c159 commit 845041e
Show file tree
Hide file tree
Showing 55 changed files with 694 additions and 504 deletions.
6 changes: 3 additions & 3 deletions api/api/v1/accounts/:id/block.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -40,7 +40,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -56,7 +56,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand Down
6 changes: 3 additions & 3 deletions api/api/v1/accounts/:id/follow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand All @@ -46,7 +46,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand All @@ -64,7 +64,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand Down
8 changes: 4 additions & 4 deletions api/api/v1/accounts/:id/followers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ beforeAll(async () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand All @@ -33,7 +33,7 @@ describe(meta.route, () => {
meta.route.replace(":id", users[1].id),
{
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -54,7 +54,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -65,7 +65,7 @@ describe(meta.route, () => {
meta.route.replace(":id", users[1].id),
{
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand Down
8 changes: 4 additions & 4 deletions api/api/v1/accounts/:id/following.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ beforeAll(async () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand All @@ -33,7 +33,7 @@ describe(meta.route, () => {
meta.route.replace(":id", users[0].id),
{
headers: {
Authorization: `Bearer ${tokens[1].accessToken}`,
Authorization: `Bearer ${tokens[1].data.accessToken}`,
},
},
);
Expand All @@ -54,7 +54,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -65,7 +65,7 @@ describe(meta.route, () => {
meta.route.replace(":id", users[0].id),
{
headers: {
Authorization: `Bearer ${tokens[1].accessToken}`,
Authorization: `Bearer ${tokens[1].data.accessToken}`,
},
},
);
Expand Down
2 changes: 1 addition & 1 deletion api/api/v1/accounts/:id/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ beforeAll(async () => {
await fakeRequest(`/api/v1/statuses/${status.id}/favourite`, {
method: "POST",
headers: {
Authorization: `Bearer ${tokens[1].accessToken}`,
Authorization: `Bearer ${tokens[1].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand Down
6 changes: 3 additions & 3 deletions api/api/v1/accounts/:id/mute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand All @@ -46,7 +46,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand All @@ -64,7 +64,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
Expand Down
16 changes: 8 additions & 8 deletions api/api/v1/accounts/:id/statuses.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ beforeAll(async () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[1].accessToken}`,
Authorization: `Bearer ${tokens[1].data.accessToken}`,
},
},
);
Expand All @@ -33,7 +33,7 @@ describe(meta.route, () => {

{
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -53,7 +53,7 @@ describe(meta.route, () => {

{
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -72,7 +72,7 @@ describe(meta.route, () => {
const replyResponse = await fakeRequest("/api/v1/statuses", {
method: "POST",
headers: {
Authorization: `Bearer ${tokens[1].accessToken}`,
Authorization: `Bearer ${tokens[1].data.accessToken}`,
},
body: new URLSearchParams({
status: "Reply",
Expand All @@ -88,7 +88,7 @@ describe(meta.route, () => {

{
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -108,7 +108,7 @@ describe(meta.route, () => {

{
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -126,7 +126,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[1].accessToken}`,
Authorization: `Bearer ${tokens[1].data.accessToken}`,
},
},
);
Expand All @@ -138,7 +138,7 @@ describe(meta.route, () => {

{
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand Down
8 changes: 4 additions & 4 deletions api/api/v1/accounts/:id/unmute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ beforeAll(async () => {
await fakeRequest(`/api/v1/accounts/${users[0].id}/mute`, {
method: "POST",
headers: {
Authorization: `Bearer ${tokens[1].accessToken}`,
Authorization: `Bearer ${tokens[1].data.accessToken}`,
},
});
});
Expand All @@ -36,7 +36,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -49,7 +49,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand All @@ -65,7 +65,7 @@ describe(meta.route, () => {
{
method: "POST",
headers: {
Authorization: `Bearer ${tokens[0].accessToken}`,
Authorization: `Bearer ${tokens[0].data.accessToken}`,
},
},
);
Expand Down
Loading

0 comments on commit 845041e

Please sign in to comment.