Skip to content

Commit

Permalink
chore: Update Sequelize to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
cicoub13 committed Mar 1, 2021
1 parent 751f13d commit cd75885
Show file tree
Hide file tree
Showing 114 changed files with 507 additions and 469 deletions.
10 changes: 5 additions & 5 deletions front/src/actions/house.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ function createActions(store) {
try {
let houseCreatedOrUpdated;

// if house has property created_at, it means it has been created.
if (house.created_at) {
// if house has property createdAt, it means it has been created.
if (house.createdAt) {
houseCreatedOrUpdated = await state.httpClient.patch(`/api/v1/house/${house.selector}`, house);
} else {
houseCreatedOrUpdated = await state.httpClient.post(`/api/v1/house`, house);
Expand Down Expand Up @@ -198,8 +198,8 @@ function createActions(store) {
rooms: {
$set: roomsWithoutDeleted
},
created_at: {
$set: houseCreatedOrUpdated.created_at
createdAt: {
$set: houseCreatedOrUpdated.createdAt
}
}
},
Expand Down Expand Up @@ -254,7 +254,7 @@ function createActions(store) {
});
const house = state.houses[houseIndex];
try {
if (house.created_at && house.selector) {
if (house.createdAt && house.selector) {
await state.httpClient.delete(`/api/v1/house/${house.selector}`);
}
const newState = update(state, {
Expand Down
6 changes: 3 additions & 3 deletions front/src/actions/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import uuid from 'uuid';
const TYPING_MIN_TIME = 400;
const TYPING_MAX_TIME = 600;

const sortMessages = messages => messages.sort((a, b) => a.created_at - b.created_at);
const sortMessages = messages => messages.sort((a, b) => a.createdAt - b.createdAt);

function createActions(store) {
const actions = {
Expand All @@ -24,7 +24,7 @@ function createActions(store) {
try {
let messages = await state.httpClient.get('/api/v1/message');
// Force date usage
messages.forEach(message => (message.created_at = new Date(message.created_at)));
messages.forEach(message => (message.createdAt = new Date(message.createdAt)));
messages = sortMessages(messages);
store.setState({
messages,
Expand Down Expand Up @@ -76,7 +76,7 @@ function createActions(store) {
try {
const newMessage = {
text: messageText,
created_at: new Date()
createdAt: new Date()
};
const tempId = uuid.v4();
// we first push the message
Expand Down
2 changes: 1 addition & 1 deletion front/src/actions/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function createActions(store) {
try {
const systemContainers = await state.httpClient.get('/api/v1/system/container');
systemContainers.forEach(container => {
container.created_at_formatted = dayjs(container.created_at * 1000)
container.createdAt_formatted = dayjs(container.createdAt * 1000)
.locale(state.user.language)
.fromNow();
});
Expand Down
Loading

0 comments on commit cd75885

Please sign in to comment.