mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-08 08:22:48 +00:00
switch from yarn to npm - other minor updates
This commit is contained in:
@@ -24,8 +24,8 @@ Made with:
|
||||
|
||||
## Build the client
|
||||
- `cd client`
|
||||
- `yarn install`
|
||||
- `yarn run dev`
|
||||
- `npm install`
|
||||
- `npm run dev`
|
||||
|
||||
# Ecto
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# Starter project for React
|
||||
- [Typescript](https://www.typescriptlang.org/)
|
||||
- [React 16](https://reactjs.org/)
|
||||
- [React Router 4](https://reacttraining.com/react-router/)
|
||||
- [Webpack 3](https://webpack.js.org/)
|
||||
- [Yarn](https://yarnpkg.com/lang/en/docs/install/)
|
||||
|
||||
## Commands
|
||||
- yarn install
|
||||
- yarn start
|
||||
|
||||
http://localhost:8080
|
||||
|
||||
## Note
|
||||
There is currently a bug with yarn not updating package.json when upgrading packages.
|
||||
[See more here](https://github.com/yarnpkg/yarn/issues/2042#issuecomment-269601927).
|
||||
I added the `update-latest` script in package.json for a temporary fix.
|
||||
@@ -130,7 +130,7 @@ export class Forum extends React.Component<Props, State> {
|
||||
|
||||
private onSearch(event: any) {
|
||||
event.preventDefault();
|
||||
const threads = filter(cloneDeep(this.state.initialThreads), (t) => {
|
||||
const threads: any = filter(cloneDeep(this.state.initialThreads), (t) => {
|
||||
return t.title.toLowerCase().match(this.state.searchText.toLowerCase());
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export class Realms extends React.Component<Props, State> {
|
||||
const realms = chain(res)
|
||||
.filter({ category: 'realm' })
|
||||
.orderBy(['title'])
|
||||
.value();
|
||||
.value() as CategoryModel[];
|
||||
this.setState({ realms });
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
16188
client/package-lock.json
generated
Normal file
16188
client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,7 @@
|
||||
"build": "webpack -p --progress --colors",
|
||||
"dev": "webpack --progress --colors --watch",
|
||||
"c9": "webpack-dev-server --host 0.0.0.0 --port 8080 --inline --history-api-fallback",
|
||||
"start": "webpack-dev-server --inline --history-api-fallback",
|
||||
"update-latest": "rm -rf node_modules && rm yarn.lock && ncu --upgrade --upgradeAll && yarn install"
|
||||
"start": "webpack-dev-server --inline --history-api-fallback"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/fingerprintjs2": "^1.5.1",
|
||||
|
||||
6732
client/yarn.lock
6732
client/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -26,13 +26,6 @@ defmodule MyApp.Data.Reply do
|
||||
end
|
||||
|
||||
# allow user to update reply
|
||||
defp user_update_changeset(reply, params \\ %{}) do
|
||||
reply
|
||||
|> cast(params, [:content])
|
||||
|> force_change(:edited, true) # set edited flag on update
|
||||
|> validate_required([:content])
|
||||
end
|
||||
|
||||
@spec insert(map) :: {:ok, map} | {:error, map}
|
||||
def insert(params) do
|
||||
{:ok, data} = Repo.transaction(fn ->
|
||||
|
||||
@@ -50,10 +50,8 @@ defmodule MyAppWeb.ReplyController do
|
||||
|
||||
@spec mod_update(map, map) :: any
|
||||
def mod_update(conn, params) do
|
||||
{:ok, _} = Data.Reply.mod_update(params)
|
||||
conn
|
||||
|> put_status(200)
|
||||
|> Response.json("ok")
|
||||
Data.Reply.mod_update(params)
|
||||
Response.json(conn, "ok")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user